-
-
Notifications
You must be signed in to change notification settings - Fork 289
chore(deps): upgrade ESLint 8 → 10 with flat config migration #3021
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
Open
kopernic-pl
wants to merge
16
commits into
develop
Choose a base branch
from
chore/eslint-10-upgrade
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7992126
chore(deps): upgrade ESLint 8 → 10 with flat config migration
kopernic-pl 103f655
chore(repo): fix prettier formatting in docs/reference
kopernic-pl ae03bed
fix(ruleset-migrator): update prettier v2 → v3 API usage in tests
kopernic-pl 58b8738
chore(deps): update yarn.lock for ruleset-migrator prettier ^3.0.0
kopernic-pl e32ffa0
chore(deps): update ruleset-bundler prettier to ^3.0.0
kopernic-pl 0d2f68c
Potential fix for pull request finding
kopernic-pl 8d36dce
fix(core): replace unsound AggregateError cast with runtime narrowing…
kopernic-pl 4e96e81
fix(repo): restore languageOptions wrapper in eslint.config.mjs lost …
kopernic-pl f76b0af
fix(repo): use fileURLToPath for tsconfigRootDir in eslint.config.mjs
kopernic-pl e13dfa9
refactor(formatters,cli): replace eslint-disable with Number() coerci…
kopernic-pl f01c4ea
chore: merge develop into chore/eslint-10-upgrade; resolve yarn.lock …
Copilot 45590ec
Merge branch 'develop' into chore/eslint-10-upgrade
kopernic-pl 1c98e5a
chore(formatters): update ESLint rules and remove unnecessary ignores
kopernic-pl 01de796
Merge branch 'develop' into chore/eslint-10-upgrade
kopernic-pl ca27542
chore(repo): add no-non-null-assertion rule with warning level so tha…
kopernic-pl 3c053b9
Merge remote-tracking branch 'origin/chore/eslint-10-upgrade' into ch…
kopernic-pl 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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 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 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,118 @@ | ||
| import tseslint from 'typescript-eslint'; | ||
| import prettierConfig from 'eslint-plugin-prettier/recommended'; | ||
| import importPlugin from 'eslint-plugin-import-x'; | ||
| import globals from 'globals'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| export default tseslint.config( | ||
| // Global ignores (replaces .eslintignore) | ||
| { | ||
| ignores: [ | ||
| '**/__fixtures__/**', | ||
| 'packages/*/dist/**', | ||
| 'packages/rulesets/src/oas/schemas/validators.ts', | ||
| 'packages/rulesets/src/arazzo/schemas/validators.ts', | ||
| 'packages/*/CHANGELOG.md', | ||
| 'packages/formatters/src/html/templates.ts', | ||
| ], | ||
| }, | ||
|
|
||
| // Base for all linted files | ||
| { | ||
| files: ['packages/**/*.{js,mjs,ts}', 'test-harness/**/*.{js,mjs,ts}'], | ||
| extends: [tseslint.configs.recommended, prettierConfig], | ||
| languageOptions: { | ||
| globals: { ...globals.es2015, ...globals.browser, ...globals.node }, | ||
| }, | ||
| rules: { | ||
| 'no-console': 'error', | ||
| 'no-control-regex': 'error', | ||
| 'no-shadow-restricted-names': 'error', | ||
| '@typescript-eslint/prefer-for-of': 'error', | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| argsIgnorePattern: '^_', | ||
| varsIgnorePattern: '^_', | ||
| args: 'after-used', | ||
| ignoreRestSiblings: true, | ||
| }, | ||
| ], | ||
| '@typescript-eslint/no-require-imports': 'warn', | ||
| '@typescript-eslint/explicit-function-return-type': 'warn', | ||
| }, | ||
| }, | ||
|
|
||
| // TypeScript source files with type-checking | ||
| { | ||
| files: ['packages/*/src/**/*.ts'], | ||
| extends: [tseslint.configs.eslintRecommended, tseslint.configs.recommendedTypeChecked], | ||
| plugins: { import: importPlugin }, | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: './tsconfig.eslint.json', | ||
| tsconfigRootDir: fileURLToPath(new URL('.', import.meta.url)), | ||
| }, | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/prefer-optional-chain': 'error', | ||
| '@typescript-eslint/prefer-regexp-exec': 'error', | ||
| '@typescript-eslint/prefer-nullish-coalescing': 'error', | ||
| '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }], | ||
| '@typescript-eslint/strict-boolean-expressions': 'warn', | ||
| '@typescript-eslint/only-throw-error': 'error', | ||
| '@typescript-eslint/no-unsafe-argument': 'warn', | ||
| '@typescript-eslint/no-non-null-assertion': 'warn', | ||
| '@typescript-eslint/no-empty-function': 'error', | ||
| 'import/no-extraneous-dependencies': [ | ||
| 'error', | ||
| { devDependencies: ['**/*.{test,spec}.ts', '**/__tests__/__helpers__/*.ts'] }, | ||
| ], | ||
| }, | ||
| }, | ||
|
|
||
| // CLI package: downgrade no-console to warn | ||
| { | ||
| files: ['packages/cli/src/**/*.ts'], | ||
| rules: { 'no-console': 'warn' }, | ||
| }, | ||
|
|
||
| // Test files: relax strict rules | ||
| { | ||
| files: ['packages/*/src/**/__tests__/**/*.ts', 'test-harness/**/*.{ts,js}'], | ||
| rules: { | ||
| '@typescript-eslint/strict-boolean-expressions': 'off', | ||
| '@typescript-eslint/explicit-function-return-type': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/no-non-null-assertion': 'off', | ||
| '@typescript-eslint/no-floating-promises': 'off', | ||
| '@typescript-eslint/no-empty-function': 'off', | ||
| '@typescript-eslint/require-await': 'off', | ||
| '@typescript-eslint/unbound-method': 'off', | ||
| '@typescript-eslint/no-require-imports': 'off', | ||
| '@typescript-eslint/prefer-promise-reject-errors': 'off', | ||
| '@typescript-eslint/no-unsafe-call': 'off', | ||
| '@typescript-eslint/no-unsafe-member-access': 'off', | ||
| '@typescript-eslint/no-unsafe-assignment': 'off', | ||
| '@typescript-eslint/restrict-template-expressions': 'off', | ||
| }, | ||
| }, | ||
|
|
||
| // Jest test files: jest + node globals | ||
| { | ||
| files: ['**/__tests__/**/*.jest.test.{ts,js}', '__mocks__/**/*.{ts,js}'], | ||
| languageOptions: { globals: { ...globals.jest, ...globals.node } }, | ||
| }, | ||
|
|
||
| // Karma test files: browser + jasmine globals | ||
| { | ||
| files: ['**/__tests__/**/*.karma.test.{ts,js}'], | ||
| languageOptions: { globals: { ...globals.browser, ...globals.jasmine } }, | ||
| }, | ||
|
|
||
| // Scripts and test-harness: node globals | ||
| { | ||
| files: ['scripts/**/*.{mjs,ts}', 'test-harness/**/*.{ts,js}'], | ||
| languageOptions: { globals: { ...globals.node } }, | ||
| }, | ||
| ); | ||
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 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 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 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 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
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.