diff --git a/.eslint-ignore b/.eslint-ignore new file mode 100644 index 00000000000..12da4a432e1 --- /dev/null +++ b/.eslint-ignore @@ -0,0 +1,36 @@ +**/build/*/**/*.js +**/dist/**/*.js +**/extensions/**/*.d.ts +**/extensions/**/build/** +**/extensions/**/colorize-fixtures/** +**/extensions/css-language-features/server/test/pathCompletionFixtures/** +**/extensions/html-language-features/server/lib/jquery.d.ts +**/extensions/html-language-features/server/src/test/pathCompletionFixtures/** +**/extensions/ipynb/notebook-out/** +**/extensions/markdown-language-features/media/** +**/extensions/markdown-language-features/notebook-out/** +**/extensions/markdown-math/notebook-out/** +**/extensions/notebook-renderers/renderer-out/index.js +**/extensions/simple-browser/media/index.js +**/extensions/typescript-language-features/test-workspace/** +**/extensions/typescript-language-features/extension.webpack.config.js +**/extensions/typescript-language-features/extension-browser.webpack.config.js +**/extensions/typescript-language-features/package-manager/node-maintainer/** +**/extensions/vscode-api-tests/testWorkspace/** +**/extensions/vscode-api-tests/testWorkspace2/** +**/fixtures/** +**/node_modules/** +**/out-*/**/*.js +**/out-editor-*/** +**/out/**/*.js +**/src/**/dompurify.js +**/src/**/marked.js +**/src/**/semver.js +**/src/typings/**/*.d.ts +**/src/vs/*/**/*.d.ts +**/src/vs/base/test/common/filters.perf.data.js +**/src/vs/loader.js +**/test/unit/assert.js +**/test/automation/out/** +**/typings/** +!.vscode diff --git a/.eslintignore.json b/.eslintignore.json deleted file mode 100644 index 1043913d5a8..00000000000 --- a/.eslintignore.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - "**/build/*/**/*.js", - "**/dist/**/*.js", - "**/extensions/**/*.d.ts", - "**/extensions/**/build/**", - "**/extensions/**/colorize-fixtures/**", - "**/extensions/css-language-features/server/test/pathCompletionFixtures/**", - "**/extensions/html-language-features/server/lib/jquery.d.ts", - "**/extensions/html-language-features/server/src/test/pathCompletionFixtures/**", - "**/extensions/ipynb/notebook-out/**", - "**/extensions/markdown-language-features/media/**", - "**/extensions/markdown-language-features/notebook-out/**", - "**/extensions/markdown-math/notebook-out/**", - "**/extensions/notebook-renderers/renderer-out/index.js", - "**/extensions/simple-browser/media/index.js", - "**/extensions/typescript-language-features/test-workspace/**", - "**/extensions/typescript-language-features/extension.webpack.config.js", - "**/extensions/typescript-language-features/extension-browser.webpack.config.js", - "**/extensions/typescript-language-features/package-manager/node-maintainer/**", - "**/extensions/vscode-api-tests/testWorkspace/**", - "**/extensions/vscode-api-tests/testWorkspace2/**", - "**/fixtures/**", - "**/node_modules/**", - "**/out-*/**/*.js", - "**/out-editor-*/**", - "**/out/**/*.js", - "**/src/**/dompurify.js", - "**/src/**/marked.js", - "**/src/**/semver.js", - "**/src/typings/**/*.d.ts", - "**/src/vs/*/**/*.d.ts", - "**/src/vs/base/test/common/filters.perf.data.js", - "**/src/vs/loader.js", - "**/test/unit/assert.js", - "**/test/automation/out/**", - "**/typings/**", - "!.vscode" -] diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index a061c23e8dc..5bb4d61d188 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -193,7 +193,7 @@ extends: eslint: enabled: true enableExclusions: true - exclusionsFilePath: $(Build.SourcesDirectory)/.eslintignore + exclusionsFilePath: $(Build.SourcesDirectory)/.eslint-ignore sourceAnalysisPool: 1es-windows-2022-x64 createAdoIssuesForJustificationsForDisablement: false containers: diff --git a/build/filters.js b/build/filters.js index fb6f00c78fb..2de31b416bf 100644 --- a/build/filters.js +++ b/build/filters.js @@ -197,7 +197,10 @@ module.exports.eslintFilter = [ '**/*.cjs', '**/*.mjs', '**/*.ts', - ...require(join(__dirname, '..', '.eslintignore.json')) + ...readFileSync(join(__dirname, '..', '.eslint-ignore')) + .toString() + .split(/\r\n|\n/) + .filter(line => line && !line.startsWith('#')) .map(line => line.startsWith('!') ? line.slice(1) : `!${line}`) ]; diff --git a/eslint.config.cjs b/eslint.config.cjs index 915e4bc3f3d..14b7893d482 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -11,7 +11,10 @@ const stylisticTs = require('@stylistic/eslint-plugin-ts'); const pluginHeader = require('eslint-plugin-header'); pluginHeader.rules.header.meta.schema = false; -const ignores = JSON.parse(fs.readFileSync(path.join(__dirname, '.eslintignore.json'), 'utf8').toString()); +const ignores = fs.readFileSync(path.join(__dirname, '.eslint-ignore'), 'utf8') + .toString() + .split(/\r\n|\n/) + .filter(line => line && !line.startsWith('#')); module.exports = tseslint.config( {