127 lines
3.4 KiB
JavaScript
127 lines
3.4 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
parser: '@typescript-eslint/parser',
|
|
plugins: [
|
|
'svelte3',
|
|
'@typescript-eslint'
|
|
],
|
|
parserOptions: {
|
|
tsconfigRootDir: __dirname,
|
|
project: [
|
|
'./tsconfig.json',
|
|
'./tsconfig.test.json'
|
|
]
|
|
},
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
],
|
|
rules: {
|
|
indent: [
|
|
'error',
|
|
4,
|
|
{
|
|
SwitchCase: 1
|
|
}
|
|
],
|
|
'no-trailing-spaces': 'error',
|
|
'max-len': [
|
|
'error',
|
|
{
|
|
code: 120,
|
|
ignoreTemplateLiterals: true,
|
|
ignoreRegExpLiterals: true
|
|
}
|
|
],
|
|
semi: 'off',
|
|
'@typescript-eslint/semi': [
|
|
'error'
|
|
],
|
|
'no-extra-semi': 'error',
|
|
'eol-last': 'error',
|
|
'comma-dangle': 'off',
|
|
'@typescript-eslint/comma-dangle': [
|
|
'error',
|
|
{
|
|
arrays: 'always-multiline',
|
|
objects: 'always-multiline',
|
|
imports: 'always-multiline',
|
|
exports: 'always-multiline',
|
|
functions: 'always-multiline',
|
|
enums: 'always-multiline',
|
|
generics: 'always-multiline',
|
|
tuples: 'always-multiline'
|
|
}
|
|
],
|
|
'no-extra-parens': 'off',
|
|
'@typescript-eslint/no-extra-parens': [
|
|
'error'
|
|
],
|
|
'no-nested-ternary': 'error',
|
|
'@typescript-eslint/no-inferrable-types': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
|
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_'
|
|
}
|
|
],
|
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
'no-useless-return': 'error',
|
|
'no-useless-constructor': 'off',
|
|
'@typescript-eslint/no-useless-constructor': [
|
|
'error'
|
|
],
|
|
'no-return-await': 'off',
|
|
'@typescript-eslint/return-await': [
|
|
'error',
|
|
'always'
|
|
],
|
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
'error',
|
|
{
|
|
accessibility: 'explicit'
|
|
}
|
|
],
|
|
'@typescript-eslint/no-floating-promises': 'error'
|
|
},
|
|
ignorePatterns: [
|
|
'.eslintrc.js',
|
|
'rollup.config.js',
|
|
'jest.config.js',
|
|
'dist/**/*',
|
|
'config/**/*',
|
|
'public/**/*',
|
|
"scripts/**/*",
|
|
],
|
|
overrides: [
|
|
{
|
|
files: [
|
|
'test/**/*'
|
|
],
|
|
rules: {
|
|
'max-len': [
|
|
'error',
|
|
{
|
|
code: 120,
|
|
ignoreTemplateLiterals: true,
|
|
ignoreRegExpLiterals: true,
|
|
ignoreStrings: true
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
files: ['*.svelte'],
|
|
processor: 'svelte3/svelte3'
|
|
}
|
|
],
|
|
settings: {
|
|
'svelte3/typescript': require('typescript'),
|
|
'svelte3/ignore-styles': function (attributes) {
|
|
return !!(attributes['lang'] && attributes['lang'] !== 'css');
|
|
}
|
|
},
|
|
}
|