Skip to content

Commit e16b4e3

Browse files
committed
add "import/extensions" and "unicorn" eslint rules
1 parent 3216502 commit e16b4e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1455
-780
lines changed

js/.eslintrc.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,38 @@ module.exports = {
66
extends: [
77
'plugin:jsdoc/recommended',
88
'airbnb-base',
9+
'plugin:unicorn/recommended',
910
'plugin:vue/vue3-recommended',
1011
],
1112
parserOptions: {
1213
ecmaVersion: '2020',
1314
sourceType: 'module',
1415
},
15-
plugins: [
16-
'vue',
17-
],
16+
settings: {
17+
'import/resolver': 'webpack',
18+
},
1819
rules: {
1920
indent: ['error', 4, { SwitchCase: 1 }],
21+
curly: ['error', 'all'],
2022
'object-shorthand': ['error', 'never'],
2123
'func-names': ['error', 'never'],
2224
'no-param-reassign': 'off',
2325
'class-methods-use-this': 'off',
24-
'import/no-unresolved': 'off',
2526
'no-plusplus': 'off',
2627
'consistent-return': 'off',
2728
'no-nested-ternary': 'off',
2829
'default-case': 'off',
29-
'import/prefer-default-export': 'off',
3030
'no-console': ['error', { allow: ['warn', 'error'] }],
31+
'no-restricted-syntax': 'off',
3132
'no-underscore-dangle': 'off',
3233
'max-len': 'off',
3334
'prefer-template': ['off'],
3435
'no-unused-vars': ['error', { vars: 'all', args: 'none' }],
36+
'padding-line-between-statements': ['error', {
37+
blankLine: 'always',
38+
prev: '*',
39+
next: ['continue', 'break', 'export', 'return', 'throw'],
40+
}],
3541
'spaced-comment': ['error', 'always', {
3642
line: {
3743
markers: ['/'],
@@ -43,13 +49,30 @@ module.exports = {
4349
balanced: true,
4450
},
4551
}],
52+
'import/no-unresolved': 'off',
53+
'import/prefer-default-export': 'off',
54+
'import/extensions': ['error', 'always', {
55+
'': 'never',
56+
js: 'never',
57+
vue: 'never',
58+
}],
4659
'vue/html-indent': ['error', 4],
4760
'jsdoc/require-param': 'off',
4861
'jsdoc/require-param-description': 'off',
4962
'jsdoc/require-returns': 'off',
5063
'jsdoc/require-returns-description': 'off',
5164
'jsdoc/require-jsdoc': 'off',
5265
'jsdoc/check-line-alignment': ['error', 'always'],
66+
'unicorn/catch-error-name': 'off',
67+
'unicorn/no-array-callback-reference': 'off',
68+
'unicorn/no-lonely-if': 'off',
69+
'unicorn/no-negated-condition': 'off',
70+
'unicorn/no-null': 'off',
71+
'unicorn/no-this-assignment': 'off',
72+
'unicorn/prefer-logical-operator-over-ternary': 'off', // nullish coalescing operator has limited support
73+
'unicorn/prefer-module': 'off',
74+
'unicorn/prevent-abbreviations': 'off',
75+
'unicorn/switch-case-braces': ['error', 'avoid'],
5376
},
5477
reportUnusedDisableDirectives: true,
5578
};

0 commit comments

Comments
 (0)