2024-08-20 15:55:39 +03:00
|
|
|
import globals from 'globals';
|
|
|
|
import pluginJs from '@eslint/js';
|
|
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
import jsdoc from 'eslint-plugin-jsdoc';
|
|
|
|
import prettier from 'eslint-config-prettier';
|
2024-09-07 17:36:54 +03:00
|
|
|
import pluginVue from 'eslint-plugin-vue';
|
2024-09-24 04:35:28 +03:00
|
|
|
import noForOfArrayPlugin from 'eslint-plugin-no-for-of-array';
|
2024-08-20 15:55:39 +03:00
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
2024-09-07 17:36:54 +03:00
|
|
|
ignores: [
|
|
|
|
'.yarn/**',
|
|
|
|
'coverage/**',
|
|
|
|
'**/dist/**',
|
|
|
|
'**/cache/**',
|
|
|
|
'.pnp.*',
|
|
|
|
'**/*.d.ts',
|
|
|
|
'**/*.tgz',
|
|
|
|
'node_modules/**',
|
|
|
|
],
|
2024-08-20 15:55:39 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.node,
|
|
|
|
...globals.browser,
|
|
|
|
...globals.jest,
|
|
|
|
...globals['shared-node-browser'],
|
|
|
|
...globals.es2015,
|
|
|
|
},
|
|
|
|
parserOptions: {
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
2024-09-07 17:36:54 +03:00
|
|
|
parser: tseslint.parser,
|
|
|
|
extraFileExtensions: ['.vue'],
|
2024-08-20 15:55:39 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pluginJs.configs.recommended,
|
|
|
|
...tseslint.configs.recommended,
|
|
|
|
prettier,
|
|
|
|
jsdoc.configs['flat/recommended'],
|
2024-09-07 17:36:54 +03:00
|
|
|
...pluginVue.configs['flat/recommended'],
|
2024-09-24 04:35:28 +03:00
|
|
|
{
|
|
|
|
files: ['src/**/*.ts'],
|
|
|
|
ignores: ['**/*.spec.ts'],
|
|
|
|
languageOptions: {
|
|
|
|
parser: tseslint.parser,
|
|
|
|
parserOptions: {
|
|
|
|
project: './tsconfig.json',
|
|
|
|
tsconfigRootDir: import.meta.dirname,
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: {
|
|
|
|
'no-for-of-array': noForOfArrayPlugin,
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'no-for-of-array/no-for-of-array': 'error',
|
|
|
|
},
|
|
|
|
},
|
2024-08-20 15:55:39 +03:00
|
|
|
{
|
|
|
|
rules: {
|
|
|
|
'no-implicit-coercion': 'error',
|
|
|
|
'no-warning-comments': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
terms: ['TODO', 'FIXME', 'XXX', 'BUG'],
|
|
|
|
location: 'anywhere',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
curly: ['error', 'all'],
|
|
|
|
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
|
|
|
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
|
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
|
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/no-parameter-properties': 'off',
|
|
|
|
'@typescript-eslint/no-require-imports': 'warn',
|
|
|
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
|
|
|
|
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
|
|
'@typescript-eslint/naming-convention': [
|
|
|
|
'error',
|
|
|
|
{ format: ['camelCase', 'UPPER_CASE', 'PascalCase'], selector: 'variable', leadingUnderscore: 'allow' },
|
|
|
|
{ format: ['camelCase', 'PascalCase'], selector: 'function' },
|
|
|
|
{ format: ['PascalCase'], selector: 'interface' },
|
|
|
|
{ format: ['PascalCase'], selector: 'typeAlias' },
|
|
|
|
],
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
|
|
|
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, caughtErrors: 'none' }],
|
|
|
|
'@typescript-eslint/member-ordering': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
default: [
|
|
|
|
'public-static-field',
|
|
|
|
'private-static-field',
|
|
|
|
'public-instance-field',
|
|
|
|
'private-instance-field',
|
|
|
|
'public-constructor',
|
|
|
|
'private-constructor',
|
|
|
|
'public-instance-method',
|
|
|
|
'private-instance-method',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'jsdoc/tag-lines': 'off',
|
|
|
|
'jsdoc/no-defaults': 'off',
|
|
|
|
'jsdoc/require-jsdoc': 'off',
|
2024-09-07 17:36:54 +03:00
|
|
|
'vue/multi-word-component-names': 'off',
|
2024-08-20 15:55:39 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|