Skip to content

Commit c1f2414

Browse files
committed
Run ESLint on all files
This wil remove the discrepancy between the files on which ESLint is run when `lint-staged` is used and the files that are checked using `npm run lint` and `npm run format`. It will now also include the `.storybook` directory which was previously excluded from the ESLint configuration.
1 parent 762288b commit c1f2414

7 files changed

Lines changed: 17 additions & 9 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", "./scripts/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",

0 commit comments

Comments
 (0)