84 lines
2.2 KiB
JavaScript
84 lines
2.2 KiB
JavaScript
const tsParser = require('@typescript-eslint/parser');
|
|
const stylisticPlugin = require('@stylistic/eslint-plugin');
|
|
const tsPlugin = require ('@typescript-eslint/eslint-plugin')
|
|
const reactPlugin = require('eslint-plugin-react');
|
|
const sortPlugin = require('eslint-plugin-simple-import-sort');
|
|
|
|
/** @type {import("eslint").FlatConfig[]} */
|
|
module.exports = [
|
|
{
|
|
ignores: ['node_modules/**', 'dist/**', 'wailjs/**'],
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
expect: 'readonly',
|
|
},
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
|
|
plugins: {
|
|
'@stylistic': stylisticPlugin,
|
|
'@typescript-eslint': tsPlugin,
|
|
react: reactPlugin,
|
|
'simple-import-sort': sortPlugin,
|
|
},
|
|
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
'@typescript-eslint/no-misused-new': 'error',
|
|
semi: ['error', 'always'],
|
|
'@typescript-eslint/no-empty-function': 'error',
|
|
'simple-import-sort/imports': 'error',
|
|
'simple-import-sort/exports': 'error',
|
|
'@stylistic/member-delimiter-style': [
|
|
'error',
|
|
{
|
|
multiline: { delimiter: 'semi', requireLast: true },
|
|
singleline: { delimiter: 'semi', requireLast: false },
|
|
},
|
|
],
|
|
'no-var': 'error',
|
|
'no-eval': 'error',
|
|
'eol-last': 'error',
|
|
'no-console': 'error',
|
|
'default-case': 'error',
|
|
semi: 'off',
|
|
'no-regex-spaces': 'error',
|
|
'constructor-super': 'error',
|
|
'no-invalid-regexp': 'error',
|
|
curly: ['error', 'multi-line'],
|
|
'no-irregular-whitespace': 'error',
|
|
'quote-props': ['error', 'as-needed'],
|
|
'linebreak-style': ['error', 'unix'],
|
|
'padding-line-between-statements': [
|
|
'error',
|
|
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
],
|
|
'prefer-const': ['error', { destructuring: 'all' }],
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
indent: [
|
|
'error',
|
|
2,
|
|
{ SwitchCase: 1, ignoredNodes: ['ConditionalExpression', 'TemplateLiteral'] },
|
|
],
|
|
},
|
|
},
|
|
|
|
{
|
|
files: ['.eslintrc.{js,cjs}'],
|
|
languageOptions: {
|
|
sourceType: 'script',
|
|
},
|
|
},
|
|
];
|