.eslintrc.cjs
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:promise/recommended',
'standard',
'plugin:sonarjs/recommended',
'plugin:unicorn/recommended',
'plugin:import/recommended',
'plugin:regexp/recommended',
'plugin:@next/next/recommended',
'plugin:prettier/recommended',
],
plugins: ['simple-import-sort', 'unused-imports', 'sort-destructure-keys'],
parserOptions: {
ecmaVersion: 2022,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'sort-destructure-keys/sort-destructure-keys': ['error', { caseSensitive: true }],
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'import/no-unresolved': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/consistent-function-scoping': 'off',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:typescript-sort-keys/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-namespace': [
'error',
{
allowDeclarations: true,
},
],
},
},
{
files: ['*.jsx', '*.tsx'],
extends: [
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
settings: {
react: {
version: 'detect',
},
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
rules: {
'react/self-closing-comp': 'error',
'react/sort-prop-types': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-closing-tag-location': 'error',
},
},
],
}
.prettierrc.cjs
module.exports = {
astroAllowShorthand: true,
arrowParens: 'avoid',
bracketSameLine: false,
bracketSpacing: true,
endOfLine: 'lf',
jsxSingleQuote: false,
printWidth: 100,
quoteProps: 'as-needed',
semi: false,
useTabs: false,
tabWidth: 2,
trailingComma: 'all',
singleQuote: true,
}