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.
This commit is contained in:
6
extensions/ql-vscode/.eslintignore
Normal file
6
extensions/ql-vscode/.eslintignore
Normal file
@@ -0,0 +1,6 @@
|
||||
.vscode-test/
|
||||
node_modules/
|
||||
out/
|
||||
|
||||
# Include the Storybook config
|
||||
!.storybook
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json", "./scripts/tsconfig.json"],
|
||||
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json", "./scripts/tsconfig.json", "./.storybook/tsconfig.json"],
|
||||
},
|
||||
plugins: ["@typescript-eslint"],
|
||||
env: {
|
||||
|
||||
@@ -7,7 +7,7 @@ import '@vscode/codicons/dist/codicon.css';
|
||||
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
|
||||
export const parameters = {
|
||||
// All props starting with `on` will automatically receive an action as a prop
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
// All props matching these names will automatically get the correct control
|
||||
controls: {
|
||||
matchers: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export function config(entry = []) {
|
||||
return [...entry, require.resolve("./preview.ts")];
|
||||
return [...entry, require.resolve('./preview.ts')];
|
||||
}
|
||||
|
||||
export function managerEntries(entry = []) {
|
||||
return [...entry, require.resolve("./manager.tsx")];
|
||||
return [...entry, require.resolve('./manager.tsx')];
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ export enum VSCodeTheme {
|
||||
export const themeNames: { [key in VSCodeTheme]: string } = {
|
||||
[VSCodeTheme.Dark]: 'Dark+',
|
||||
[VSCodeTheme.Light]: 'Light+',
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,9 +4,11 @@ import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from
|
||||
import { VSCodeTheme } from './theme';
|
||||
|
||||
const themeFiles: { [key in VSCodeTheme]: string } = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
[VSCodeTheme.Dark]: require('!file-loader?modules!../../src/stories/vscode-theme-dark.css').default,
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
[VSCodeTheme.Light]: require('!file-loader?modules!../../src/stories/vscode-theme-light.css').default,
|
||||
}
|
||||
};
|
||||
|
||||
export const withTheme = (
|
||||
StoryFn: StoryFunction<AnyFramework>,
|
||||
@@ -18,7 +20,7 @@ export const withTheme = (
|
||||
const styleSelectorId =
|
||||
context.viewMode === 'docs'
|
||||
? `addon-vscode-theme-docs-${context.id}`
|
||||
: `addon-vscode-theme-theme`;
|
||||
: 'addon-vscode-theme-theme';
|
||||
|
||||
const theme = Object.values(VSCodeTheme).includes(vscodeTheme) ? vscodeTheme as VSCodeTheme : VSCodeTheme.Dark;
|
||||
|
||||
|
||||
@@ -1254,8 +1254,8 @@
|
||||
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
|
||||
"cli-integration": "npm run preintegration && node ./out/vscode-tests/run-integration-tests.js cli-integration",
|
||||
"update-vscode": "node ./node_modules/vscode/bin/install",
|
||||
"format": "tsfmt -r && eslint src test --ext .ts,.tsx --fix",
|
||||
"lint": "eslint src test --ext .ts,.tsx --max-warnings=0",
|
||||
"format": "tsfmt -r && eslint . --ext .ts,.tsx --fix",
|
||||
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
|
||||
"format-staged": "lint-staged",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook",
|
||||
|
||||
Reference in New Issue
Block a user