-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
2,327 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// import { fileURLToPath } from 'node:url'; | ||
|
||
import eslint from '@eslint/js'; | ||
import nodePlugin from 'eslint-plugin-n'; | ||
import simpleImportSort from 'eslint-plugin-simple-import-sort'; | ||
import tsEslint from 'typescript-eslint'; | ||
|
||
// import { FlatCompat } from '@eslint/eslintrc'; | ||
|
||
// const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
// const compat = new FlatCompat({ | ||
// baseDirectory: __dirname, | ||
// }); | ||
|
||
export default tsEslint.config( | ||
nodePlugin.configs['flat/recommended'], | ||
{ | ||
rules: { | ||
'n/exports-style': ['error', 'module.exports'], | ||
'n/no-extraneous-import': 'error', | ||
'n/no-unpublished-import': [ | ||
'error', | ||
{ | ||
ignoreTypeImport: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
eslint.configs.recommended, | ||
...tsEslint.configs.recommended, | ||
{ | ||
ignores: [ | ||
'**/[Ss]amples/**', // cspell:disable-line | ||
'**/[Tt]emp/**', | ||
'**/.temp/**', | ||
'**/*.d.ts', | ||
'**/*.d.cts', | ||
'**/*.d.mts', | ||
'**/src/lib*/*.cjs', | ||
'**/*.map', | ||
'**/coverage/**', | ||
'**/cspell-default.config.js', | ||
'**/dist/**', | ||
'**/dist.*/**', | ||
'tools/*/lib/**', | ||
'**/node_modules/**', | ||
'**/.docusaurus/**', | ||
'docs/_site/**', | ||
'docs/docsV2/**', | ||
'docs/types/cspell-types/**', | ||
'integration-tests/repositories/**', | ||
'packages/*/fixtures/**', | ||
'packages/*/esm/**', | ||
'test-fixtures/**', | ||
'test-packages/cspell-eslint-plugin/**', | ||
'test-packages/yarn/**', | ||
'website', | ||
'**/lib-bundled/**', | ||
'website/**', // checked with a different config | ||
|
||
// Ignore cspell-eslint-plugin | ||
'fixtures/**', | ||
], | ||
}, | ||
{ | ||
plugins: { | ||
'simple-import-sort': simpleImportSort, | ||
}, | ||
rules: { | ||
'simple-import-sort/imports': 'error', | ||
'simple-import-sort/exports': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.mts', '**/*.cts'], | ||
rules: { | ||
'no-restricted-modules': 'error', | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], | ||
// This is caught by 'import/no-unresolved' | ||
'node/no-missing-import': [ | ||
'off', | ||
{ | ||
tryExtensions: ['.js', '.d.ts', '.ts'], | ||
}, | ||
], | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
// 'import/no-unresolved': 'off', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.mts', '**/*.cts'], | ||
rules: { | ||
'node/no-missing-import': [ | ||
'off', | ||
{ | ||
tryExtensions: ['.js', '.d.ts', '.ts'], | ||
}, | ||
], | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
'import/no-unresolved': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['packages/cspell-pipe/**/*.ts'], | ||
rules: { | ||
'import/extensions': ['error', 'ignorePackages'], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js', '**/*.mjs'], | ||
rules: { | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
}, | ||
}, | ||
{ | ||
files: [ | ||
'vitest.config.*', | ||
'**/*.test.*', | ||
'**/test.*', | ||
'**/rollup.*', | ||
'**/*.spec.*', | ||
'**/test-helpers/**', | ||
'**/test-utils/**', | ||
'**/src/test/**', | ||
'**/src/perf/**', | ||
], | ||
rules: { | ||
'node/no-extraneous-import': 'off', | ||
'node/no-extraneous-require': 'off', | ||
'node/no-unpublished-import': 'off', | ||
}, | ||
}, | ||
); |
35 changes: 0 additions & 35 deletions
35
packages/cspell-eslint-plugin/fixtures/issue-4870/.eslintrc.js
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
packages/cspell-eslint-plugin/fixtures/issue-4870/eslint.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import eslint from '@eslint/js'; | ||
import nodePlugin from 'eslint-plugin-n'; | ||
import cspellRecommended from '@cspell/eslint-plugin/recommended'; | ||
|
||
/** | ||
* @type { import("eslint").Linter.FlatConfig[] } | ||
*/ | ||
const config = [ | ||
eslint.configs.recommended, | ||
nodePlugin.configs['flat/recommended-module'], | ||
{ | ||
rules: { | ||
'n/no-extraneous-import': 'off', | ||
'n/no-unpublished-import': 'off', | ||
}, | ||
}, | ||
cspellRecommended, | ||
{ | ||
rules: { | ||
'@cspell/spellchecker': [ | ||
'warn', | ||
{ | ||
debugMode: false, | ||
autoFix: true, | ||
cspell: { | ||
dictionaries: ['business-terminology'], | ||
dictionaryDefinitions: [ | ||
{ | ||
name: 'business-terminology', | ||
path: './dictionaries/business-terminology.txt', | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
]; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/cspell-eslint-plugin/src/test/eslint-plugin-react.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module 'eslint-plugin-react'; |
Oops, something went wrong.