generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade all dev dependencies (#376)
Upgrade available minor and patch versions of all dependencies, and ESLint v9. As part of ESLint major upgrade the ESLint config was migrated to flat config, the plugins and rules used were cleaned up, and minor lint issues were fixed.
- Loading branch information
Showing
8 changed files
with
104 additions
and
18,297 deletions.
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 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,4 @@ | ||
{ | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"eslint.experimental.useFlatConfig": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,89 @@ | ||
import tsEslint from 'typescript-eslint' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import stylistic from '@stylistic/eslint-plugin' | ||
import js from '@eslint/js' | ||
|
||
import { FlatCompat } from '@eslint/eslintrc' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}) | ||
|
||
const recommendedConfig = [ | ||
{ | ||
files: ['**/*.ts', '**/*.tsx'], | ||
...tsEslint.configs.base, | ||
languageOptions: { | ||
...tsEslint.configs.base.languageOptions, | ||
parserOptions: { | ||
EXPERIMENTAL_useProjectService: true, | ||
sourceType: 'module', | ||
}, | ||
}, | ||
}, | ||
// extract recommended config from typescript-eslint and enable it only for TS files | ||
...[ | ||
...tsEslint.configs.recommended, | ||
...tsEslint.configs.recommendedTypeChecked, | ||
...tsEslint.configs.stylistic, | ||
...tsEslint.configs.stylisticTypeChecked, | ||
] | ||
.map(({ rules, files }) => | ||
rules ? { rules, files: files ?? ['**/*.ts', '**/*.tsx'] } : undefined, | ||
) | ||
.filter(Boolean), | ||
] | ||
|
||
export default [ | ||
{ ignores: ['**/__generated__/**', 'node_modules/**', 'lib/**', 'dist/**'] }, | ||
{ | ||
linterOptions: { | ||
reportUnusedDisableDirectives: true, | ||
}, | ||
}, | ||
...recommendedConfig, | ||
stylistic.configs['recommended-flat'], | ||
js.configs.recommended, | ||
...compat | ||
.config({ | ||
extends: ['prettier'], | ||
}) | ||
.map(config => ({ | ||
...config, | ||
})), | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], | ||
rules: { | ||
/** | ||
* SECTION START: Disabled rules colliding with Prettier | ||
*/ | ||
'@stylistic/no-tabs': 'off', | ||
'@stylistic/indent': 'off', | ||
'@stylistic/semi': 'off', | ||
'@stylistic/brace-style': 'off', | ||
'@stylistic/member-delimiter-style': 'off', | ||
'@stylistic/quotes': 'off', | ||
'@stylistic/indent-binary-ops': 'off', | ||
'@stylistic/operator-linebreak': 'off', | ||
'@stylistic/arrow-parens': 'off', | ||
'@stylistic/quote-props': 'off', | ||
'@stylistic/no-mixed-spaces-and-tabs': 'off', | ||
/** | ||
* SECTION END | ||
*/ | ||
'no-console': 'off', | ||
'no-restricted-syntax': 'off', | ||
'arrow-parens': 'off', | ||
'no-underscore-dangle': 'off', | ||
camelcase: 'off', | ||
semi: 'off', | ||
'implicit-arrow-linebreak': 'off', | ||
'no-undef': 'off', | ||
}, | ||
}, | ||
] |
Oops, something went wrong.