Skip to content

Commit 1e1c7d4

Browse files
authored
Merge pull request #1684 from github/koesie10/fix-eslint
Fix ESLint configuration for `scripts` directory
2 parents 1cce7ae + c1f2414 commit 1e1c7d4

9 files changed

Lines changed: 26 additions & 12 deletions

File tree

extensions/ql-vscode/.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode-test/
2+
node_modules/
3+
out/
4+
5+
# Include the Storybook config
6+
!.storybook

extensions/ql-vscode/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
parserOptions: {
44
ecmaVersion: 2018,
55
sourceType: "module",
6-
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json"],
6+
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json", "./scripts/tsconfig.json", "./.storybook/tsconfig.json"],
77
},
88
plugins: ["@typescript-eslint"],
99
env: {

extensions/ql-vscode/.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import '@vscode/codicons/dist/codicon.css';
77
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
88
export const parameters = {
99
// All props starting with `on` will automatically receive an action as a prop
10-
actions: { argTypesRegex: "^on[A-Z].*" },
10+
actions: { argTypesRegex: '^on[A-Z].*' },
1111
// All props matching these names will automatically get the correct control
1212
controls: {
1313
matchers: {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function config(entry = []) {
2-
return [...entry, require.resolve("./preview.ts")];
2+
return [...entry, require.resolve('./preview.ts')];
33
}
44

55
export function managerEntries(entry = []) {
6-
return [...entry, require.resolve("./manager.tsx")];
6+
return [...entry, require.resolve('./manager.tsx')];
77
}

extensions/ql-vscode/.storybook/vscode-theme-addon/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export enum VSCodeTheme {
66
export const themeNames: { [key in VSCodeTheme]: string } = {
77
[VSCodeTheme.Dark]: 'Dark+',
88
[VSCodeTheme.Light]: 'Light+',
9-
}
9+
};

extensions/ql-vscode/.storybook/vscode-theme-addon/withTheme.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from
44
import { VSCodeTheme } from './theme';
55

66
const themeFiles: { [key in VSCodeTheme]: string } = {
7+
// eslint-disable-next-line @typescript-eslint/no-var-requires
78
[VSCodeTheme.Dark]: require('!file-loader?modules!../../src/stories/vscode-theme-dark.css').default,
9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
810
[VSCodeTheme.Light]: require('!file-loader?modules!../../src/stories/vscode-theme-light.css').default,
9-
}
11+
};
1012

1113
export const withTheme = (
1214
StoryFn: StoryFunction<AnyFramework>,
@@ -18,7 +20,7 @@ export const withTheme = (
1820
const styleSelectorId =
1921
context.viewMode === 'docs'
2022
? `addon-vscode-theme-docs-${context.id}`
21-
: `addon-vscode-theme-theme`;
23+
: 'addon-vscode-theme-theme';
2224

2325
const theme = Object.values(VSCodeTheme).includes(vscodeTheme) ? vscodeTheme as VSCodeTheme : VSCodeTheme.Dark;
2426

extensions/ql-vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,8 @@
12541254
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
12551255
"cli-integration": "npm run preintegration && node ./out/vscode-tests/run-integration-tests.js cli-integration",
12561256
"update-vscode": "node ./node_modules/vscode/bin/install",
1257-
"format": "tsfmt -r && eslint src test --ext .ts,.tsx --fix",
1258-
"lint": "eslint src test --ext .ts,.tsx --max-warnings=0",
1257+
"format": "tsfmt -r && eslint . --ext .ts,.tsx --fix",
1258+
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
12591259
"format-staged": "lint-staged",
12601260
"storybook": "start-storybook -p 6006",
12611261
"build-storybook": "build-storybook",

extensions/ql-vscode/scripts/fix-scenario-file-numbering.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as fs from 'fs-extra';
1414
import * as path from 'path';
1515

1616
if (process.argv.length !== 3) {
17-
console.error('Expected 1 argument - the scenario name')
17+
console.error('Expected 1 argument - the scenario name');
1818
}
1919

2020
const scenarioName = process.argv[2];
@@ -39,7 +39,7 @@ async function fixScenarioFiles() {
3939
});
4040

4141
let index = 0;
42-
for (let file of orderedFiles) {
42+
for (const file of orderedFiles) {
4343
const ext = path.extname(file);
4444
if (ext === '.json') {
4545
const fileName = path.basename(file, ext);
@@ -66,7 +66,7 @@ async function fixScenarioFiles() {
6666
await fs.writeJSON(newFilePath, json);
6767
}
6868
}
69-
69+
7070
index++;
7171
}
7272
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "../tsconfig.json",
4+
"include": ["**/*.ts"],
5+
"exclude": []
6+
}

0 commit comments

Comments
 (0)