-
-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: migrate eslint config to flat format #4887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1254db9
feat: replace eslintrc.json files
jdegand 5661c1e
fix: remove reference to eslintrc.json in nx.json
jdegand 727cb96
feat(package.json): change lint command
jdegand 6764780
chore(eslint): add ts-check to config files
jdegand e8d26e3
Revert "chore(eslint): add ts-check to config files"
jdegand 15a5c96
fix: change wildcard in parserOptions
jdegand 441378f
fix: cypress config in example-app
jdegand 30f9b8f
refactor: cypress configs
jdegand 8671a5a
fix: effects config project file path
jdegand 4fa1936
fix: exclude files for data config
jdegand f20590c
fix: exclude jest in configs
jdegand 3e5cb40
fix(entity): exclude standalone
jdegand 3595758
fix: component-store, component, and potentially router-store
jdegand 89b5d53
fix: exclude test-setup in router-store
jdegand 0427dd6
fix: exclude jest in store config
jdegand 9baba88
fix: exclude module boundaries
jdegand 59d187f
fix: remove references to store in effects config
jdegand 70c6a30
fix: remove cypress plugin from configs
jdegand a0ecfb4
chore: merge main
jdegand 4b12129
fix: pnpm-lock
jdegand 49757c0
revert: md file
jdegand 825948e
fix: tsconfig in store
jdegand d0cc0bb
chore: convert to eslint config in www
jdegand abdadfa
fix: lint errors and most warnings
jdegand dda0e34
Merge branch 'main' into eslint
jdegand 3dd0f0f
fix: index.html
jdegand 530c2d8
fix: update tags
jdegand f6ed7de
fix: my-counter tags
jdegand e6e1cda
fix: import AppComponent
jdegand 776b53d
chore: revert selector changes from legacy docs
markostanimirovic 5684a0f
Merge branch 'main' into eslint
markostanimirovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,110 @@ | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import js from '@eslint/js'; | ||
import nxEslintPlugin from '@nx/eslint-plugin'; | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: dirname(fileURLToPath(import.meta.url)), | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
{ plugins: { '@nx': nxEslintPlugin } }, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], | ||
rules: { | ||
'@nx/enforce-module-boundaries': [ | ||
'error', | ||
{ | ||
allow: [], | ||
depConstraints: [ | ||
{ | ||
sourceTag: '*', | ||
onlyDependOnLibsWithTags: ['*'], | ||
}, | ||
], | ||
}, | ||
], | ||
'@typescript-eslint/member-ordering': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'warn', | ||
}, | ||
}, | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/typescript'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'], | ||
rules: { | ||
...config.rules, | ||
'no-extra-semi': 'off', | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/javascript'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'], | ||
rules: { | ||
...config.rules, | ||
'no-extra-semi': 'off', | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
plugins: ['eslint-plugin-import', '@typescript-eslint'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.ts'], | ||
rules: { | ||
...config.rules, | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_', | ||
}, | ||
], | ||
'@typescript-eslint/naming-convention': 'off', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/no-empty-function': 'warn', | ||
'@typescript-eslint/no-empty-object-type': 'warn', | ||
eqeqeq: ['off', 'smart'], | ||
'id-blacklist': [ | ||
'error', | ||
'any', | ||
'Number', | ||
'number', | ||
'String', | ||
'string', | ||
'Boolean', | ||
'boolean', | ||
'Undefined', | ||
'undefined', | ||
], | ||
'id-match': 'error', | ||
'no-eval': 'off', | ||
'no-redeclare': 'off', | ||
'no-underscore-dangle': 'off', | ||
'no-var': 'error', | ||
'no-prototype-builtins': 'off', | ||
'@typescript-eslint/no-wrapper-object-types': 'off', | ||
'@typescript-eslint/no-unsafe-function-type': 'off', | ||
}, | ||
})), | ||
{ | ||
files: ['**/*.html'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,54 @@ | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import js from '@eslint/js'; | ||
import baseConfig from '../../eslint.config.mjs'; | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: dirname(fileURLToPath(import.meta.url)), | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
...baseConfig, | ||
...compat | ||
.config({ | ||
extends: [ | ||
'plugin:@nx/angular', | ||
'plugin:@angular-eslint/template/process-inline-templates', | ||
], | ||
plugins: ['@typescript-eslint'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.ts'], | ||
rules: { | ||
...config.rules, | ||
'@angular-eslint/directive-selector': 'off', | ||
'@angular-eslint/component-selector': 'off', | ||
'@angular-eslint/prefer-standalone': 'off', | ||
}, | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['modules/component-store/tsconfig.*?.json'], | ||
}, | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/angular-template'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.html'], | ||
rules: { | ||
...config.rules, | ||
}, | ||
})), | ||
{ | ||
ignores: ['schematics-core'], | ||
}, | ||
]; |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,55 @@ | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import js from '@eslint/js'; | ||
import baseConfig from '../../eslint.config.mjs'; | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: dirname(fileURLToPath(import.meta.url)), | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
...baseConfig, | ||
...compat | ||
.config({ | ||
extends: [ | ||
'plugin:@nx/angular', | ||
'plugin:@angular-eslint/template/process-inline-templates', | ||
], | ||
plugins: ['@typescript-eslint'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.ts'], | ||
rules: { | ||
...config.rules, | ||
'@angular-eslint/directive-selector': 'off', | ||
'@angular-eslint/component-selector': 'off', | ||
'@angular-eslint/no-input-rename': 'off', | ||
'@angular-eslint/prefer-standalone': 'off', | ||
}, | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['modules/component/tsconfig.*?.json'], | ||
}, | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/angular-template'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.html'], | ||
rules: { | ||
...config.rules, | ||
}, | ||
})), | ||
{ | ||
ignores: ['schematics-core'], | ||
}, | ||
]; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.