-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12f99d0
commit 841cb51
Showing
14 changed files
with
246 additions
and
327 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 |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// @ts-check | ||
import 'tsx'; | ||
|
||
import { FlatCompat } from '@eslint/eslintrc'; | ||
|
||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import eslintPluginYml from 'eslint-plugin-yml'; | ||
import eslint from '@eslint/js'; | ||
import { parse, parseForESLint } from '@typescript-eslint/parser'; | ||
const eslintPluginLyne = await import('./tools/eslint/index.ts'); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: import.meta.resolve('.'), | ||
}); | ||
|
||
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */ | ||
export default [ | ||
{ | ||
settings: { | ||
'import-x/resolver': { | ||
typescript: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
languageOptions: { | ||
globals: { ...globals.browser }, | ||
ecmaVersion: 2020, | ||
parser: { parse, parseForESLint }, | ||
}, | ||
}, | ||
{ | ||
ignores: [ | ||
'**/*.chromatic.stories.*', | ||
'dist/**/*', | ||
'tools/generate-component/boilerplate/**/*', | ||
'**/__snapshots__/**/*', | ||
], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...eslintPluginYml.configs['flat/standard'], | ||
...eslintPluginYml.configs['flat/prettier'], | ||
...compat.extends( | ||
'plugin:lit/recommended', | ||
'plugin:import-x/recommended', | ||
'plugin:import-x/typescript', | ||
), | ||
eslintPluginLyne.default.configs.recommended, | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'@typescript-eslint/array-type': 'error', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }], | ||
'@typescript-eslint/explicit-member-accessibility': 'error', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
format: ['PascalCase'], | ||
selector: 'interface', | ||
}, | ||
{ | ||
format: ['camelCase'], | ||
selector: 'default', | ||
}, | ||
{ | ||
format: ['camelCase', 'UPPER_CASE'], | ||
selector: 'variable', | ||
}, | ||
{ | ||
format: ['camelCase'], | ||
leadingUnderscore: 'allow', | ||
selector: 'parameter', | ||
}, | ||
{ | ||
format: ['camelCase'], | ||
leadingUnderscore: 'require', | ||
modifiers: ['private'], | ||
selector: 'memberLike', | ||
}, | ||
{ | ||
format: ['PascalCase'], | ||
selector: 'typeLike', | ||
}, | ||
{ | ||
format: null, | ||
selector: 'objectLiteralProperty', | ||
}, | ||
], | ||
// TODO: Remove this after fixing issues | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
args: 'all', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'@typescript-eslint/no-use-before-define': 'error', | ||
// TODO: Evaluate this rule | ||
'@typescript-eslint/semi': 'error', | ||
|
||
'import-x/first': 'error', | ||
'import-x/no-absolute-path': 'error', | ||
'import-x/no-cycle': 'error', | ||
'import-x/no-self-import': 'error', | ||
'import-x/no-unresolved': [ | ||
'error', | ||
{ | ||
ignore: [ | ||
'\\.md\\?raw$', | ||
'\\.svg\\?raw$', | ||
'\\.scss\\?lit\\&inline', | ||
// Broken. Maybe due to commonjs? | ||
'@storybook/addon-actions/decorator', | ||
], | ||
}, | ||
], | ||
'import-x/no-useless-path-segments': 'error', | ||
'import-x/order': [ | ||
'error', | ||
{ | ||
alphabetize: { order: 'asc', caseInsensitive: true }, | ||
'newlines-between': 'always', | ||
}, | ||
], | ||
// TODO Discuss this with the team | ||
'lit/no-invalid-html': 'off', | ||
camelcase: 'off', | ||
}, | ||
}, | ||
|
||
eslintConfigPrettier, | ||
]; |
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
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
Oops, something went wrong.