-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate eslint to flat config (#1926)
- Loading branch information
Showing
12 changed files
with
1,281 additions
and
2,682 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
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,94 @@ | ||
// @ts-check | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
import { includeIgnoreFile } from '@eslint/compat' | ||
|
||
import angular from 'angular-eslint' | ||
import tseslint from 'typescript-eslint' | ||
import stylistic from '@stylistic/eslint-plugin' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
const gitignorePath = path.resolve(__dirname, '.gitignore') | ||
|
||
export default tseslint.config( | ||
includeIgnoreFile(gitignorePath), | ||
|
||
{ | ||
name: 'tsc options', | ||
files: ['**/*.ts'], | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
project: ['tsconfig.json', 'e2e/tsconfig.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
name: 'angular ts recommended rules', | ||
files: ['**/*.ts'], | ||
plugins: { | ||
'@stylistic': stylistic, | ||
}, | ||
extends: [ | ||
...tseslint.configs.recommended, | ||
...tseslint.configs.stylistic, | ||
...angular.configs.tsRecommended, | ||
], | ||
rules: { | ||
'@angular-eslint/no-output-on-prefix': 'off', | ||
|
||
'@stylistic/no-multiple-empty-lines': [ | ||
'error', | ||
{ | ||
max: 1, | ||
maxBOF: 0, | ||
maxEOF: 1, | ||
}, | ||
], | ||
'@stylistic/semi': ['error', 'never'], | ||
'@stylistic/member-delimiter-style': [ | ||
'error', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: true, | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false, | ||
}, | ||
multilineDetection: 'brackets', | ||
}, | ||
], | ||
|
||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'parameter', | ||
format: ['camelCase'], | ||
filter: { | ||
regex: '^Quill$', | ||
match: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
{ | ||
name: 'angular template recommended rules', | ||
files: ['**/*.html'], | ||
extends: [ | ||
...angular.configs.templateRecommended, | ||
...angular.configs.templateAccessibility, | ||
], | ||
rules: { | ||
'@angular-eslint/template/no-negated-async': 'off', | ||
}, | ||
}, | ||
) |
Oops, something went wrong.