-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESLint 9, flat config migration (#1537)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Aaron Moat <[email protected]> Co-authored-by: skuba <[email protected]> Co-authored-by: Sam Chung <[email protected]>
- Loading branch information
1 parent
c9c79a7
commit 7797915
Showing
63 changed files
with
1,857 additions
and
912 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
'skuba': major | ||
--- | ||
|
||
lint: Migrate to ESLint 9 and `@typescript-eslint` 8. | ||
|
||
These changes may affect your project setup if customising your ESLint configuration. See the individual migration guides: | ||
|
||
- https://eslint.org/docs/latest/use/migrate-to-9.0.0 | ||
- https://typescript-eslint.io/blog/announcing-typescript-eslint-v8 | ||
|
||
In addition, through these major upgrades, some lint rules have changed or have been renamed. You will likely need adjust your code after running ESLint. | ||
|
||
Furthermore, `eslint-plugin-import` has been replaced with `eslint-plugin-import-x`. To migrate, any references to `eslint-plugin-import` should be replaced with `eslint-plugin-import-x`, and `import/` rules with `import-x/`. | ||
|
||
As part of this migration, skuba has migrated to using Flat ESLint configuration. Read the migration: https://eslint.org/docs/latest/use/configure/migration-guide. | ||
|
||
`skuba format` will attempt to migrate to flat configuration for you, where `.eslintignore` and `.eslintrc` are replaced by `eslint.config.js`. |
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,20 @@ | ||
--- | ||
'skuba': minor | ||
--- | ||
|
||
lint: Replace `.buildkite/` files with duplicated YAML merge keys, for example: | ||
|
||
```yaml | ||
# Before | ||
- <<: *deploy | ||
<<: *docker | ||
label: stuff | ||
|
||
# After | ||
- <<: [*deploy, *docker] | ||
label: stuff | ||
``` | ||
This should have no functional change, and is to support standardised YAML parsing across different tools, including the latest ESLint upgrades. | ||
This migration will not be capture all cases of this (e.g. if there are keys between the merge keys). If you have other cases, update them following the example above. |
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,16 @@ | ||
--- | ||
'eslint-config-skuba': major | ||
--- | ||
|
||
Migrate to ESLint 9, `@typescript-eslint` 8, `eslint-config-seek` 14. | ||
|
||
These changes may affect your project setup if customising your ESLint configuration. See the individual migration guides: | ||
|
||
- https://eslint.org/docs/latest/use/migrate-to-9.0.0 | ||
- https://typescript-eslint.io/blog/announcing-typescript-eslint-v8 | ||
|
||
Through these major upgrades, some lint rules have changed or have been renamed. You will likely need to adjust your code after running ESLint. | ||
|
||
As part of this migration, this project has migrated to Flat ESLint configuration. Read the migration: https://eslint.org/docs/latest/use/configure/migration-guide. | ||
|
||
Furthermore, `eslint-plugin-import` has been replaced with `eslint-plugin-import-x`. To migrate, any references to `eslint-plugin-import` should be replaced with `eslint-plugin-import-x`, and `import/` rules with `import-x/`. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
module.exports = { | ||
extends: ['skuba'], | ||
}; | ||
module.exports = require('eslint-config-skuba'); |
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,56 @@ | ||
const tsParser = require('@typescript-eslint/parser'); | ||
|
||
const skuba = require('eslint-config-skuba'); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: [ | ||
'integration/base/', | ||
'integration/format/', | ||
'template/', | ||
'packages/**/*/lib*/', | ||
], | ||
}, | ||
...skuba, | ||
{ | ||
rules: { | ||
'no-process-exit': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['integration/**/*.{ts,cts,mts,tsx}'], | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 5, | ||
sourceType: 'script', | ||
|
||
parserOptions: { | ||
allowAutomaticSingleRunInference: false, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['src/**/*.{ts,cts,mts,tsx}'], | ||
|
||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: [ | ||
{ | ||
name: 'fs', | ||
message: | ||
'Prefer fs-extra as it implements graceful-fs behaviour.', | ||
}, | ||
{ | ||
name: 'fs/promises', | ||
message: | ||
'Prefer fs-extra as it implements graceful-fs behaviour.', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
module.exports = require('.'); |
Oops, something went wrong.