75 lines
2.2 KiB
JavaScript
75 lines
2.2 KiB
JavaScript
// eslint.config.js
|
|
import globals from 'globals';
|
|
import tseslint from 'typescript-eslint';
|
|
import eslint from '@eslint/js';
|
|
import nextPlugin from '@next/eslint-plugin-next';
|
|
import unicornPlugin from 'eslint-plugin-unicorn';
|
|
import prettierConfig from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
eslint.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
|
|
plugins: {
|
|
'@next/next': nextPlugin,
|
|
unicorn: unicornPlugin,
|
|
},
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
parser: tseslint.parser,
|
|
parserOptions: {
|
|
project: './tsconfig.json',
|
|
},
|
|
},
|
|
rules: {
|
|
...nextPlugin.configs.recommended.rules,
|
|
...nextPlugin.configs['core-web-vitals'].rules,
|
|
'unicorn/prevent-abbreviations': 'off',
|
|
'unicorn/no-null': 'off',
|
|
'unicorn/prefer-string-replace-all': 'off',
|
|
'unicorn/prefer-string-slice': 'off',
|
|
'unicorn/prefer-number-properties': 'off',
|
|
'unicorn/no-array-reduce': 'off',
|
|
'unicorn/no-array-for-each': 'off',
|
|
'unicorn/prefer-global-this': 'off',
|
|
'unicorn/no-useless-undefined': 'off',
|
|
'unicorn/explicit-length-check': 'off',
|
|
'unicorn/consistent-existence-index-check': 'off',
|
|
'unicorn/prefer-ternary': 'off',
|
|
'unicorn/numeric-separators-style': 'off',
|
|
'unicorn/filename-case': [
|
|
'error',
|
|
{
|
|
cases: {
|
|
camelCase: true,
|
|
pascalCase: true,
|
|
kebabCase: true,
|
|
},
|
|
},
|
|
],
|
|
'unicorn/prefer-add-event-listener': 'off',
|
|
'unicorn/prefer-spread': 'off',
|
|
'unicorn/consistent-function-scoping': 'off',
|
|
'unicorn/no-document-cookie': 'off',
|
|
'unicorn/no-negated-condition': 'off',
|
|
'unicorn/prefer-code-point': 'off',
|
|
'unicorn/prefer-single-call': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'prefer-const': 'off',
|
|
},
|
|
},
|
|
prettierConfig,
|
|
];
|