🚨(frontend) add lib eslint-config-impress

Create the eslint-config-impress package to share
eslint configuration with all impress projects.
This commit is contained in:
Anthony LC
2024-04-02 12:09:10 +02:00
parent c3e354d727
commit c64b66c797
10 changed files with 11635 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
const eslintTS = [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
},
},
{
files: ['*.d.ts'],
rules: {
'no-unused-vars': 'off',
},
},
];
const globalRules = {
'block-scoped-var': 'error',
curly: ['error', 'all'],
'import/no-duplicates': ['error', { considerQueryString: false }],
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
warnOnUnassignedImports: true,
},
],
'no-alert': 'error',
'no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never', propElementValues: 'always' },
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
};
module.exports = { eslintTS, globalRules };