Skip to content

Commit

Permalink
add "import/extensions" and "unicorn" eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Nov 26, 2022
1 parent 3216502 commit e16b4e3
Show file tree
Hide file tree
Showing 44 changed files with 1,455 additions and 780 deletions.
33 changes: 28 additions & 5 deletions js/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,38 @@ module.exports = {
extends: [
'plugin:jsdoc/recommended',
'airbnb-base',
'plugin:unicorn/recommended',
'plugin:vue/vue3-recommended',
],
parserOptions: {
ecmaVersion: '2020',
sourceType: 'module',
},
plugins: [
'vue',
],
settings: {
'import/resolver': 'webpack',
},
rules: {
indent: ['error', 4, { SwitchCase: 1 }],
curly: ['error', 'all'],
'object-shorthand': ['error', 'never'],
'func-names': ['error', 'never'],
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
'import/no-unresolved': 'off',
'no-plusplus': 'off',
'consistent-return': 'off',
'no-nested-ternary': 'off',
'default-case': 'off',
'import/prefer-default-export': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
'max-len': 'off',
'prefer-template': ['off'],
'no-unused-vars': ['error', { vars: 'all', args: 'none' }],
'padding-line-between-statements': ['error', {
blankLine: 'always',
prev: '*',
next: ['continue', 'break', 'export', 'return', 'throw'],
}],
'spaced-comment': ['error', 'always', {
line: {
markers: ['/'],
Expand All @@ -43,13 +49,30 @@ module.exports = {
balanced: true,
},
}],
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'import/extensions': ['error', 'always', {
'': 'never',
js: 'never',
vue: 'never',
}],
'vue/html-indent': ['error', 4],
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/check-line-alignment': ['error', 'always'],
'unicorn/catch-error-name': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-lonely-if': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-null': 'off',
'unicorn/no-this-assignment': 'off',
'unicorn/prefer-logical-operator-over-ternary': 'off', // nullish coalescing operator has limited support
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': ['error', 'avoid'],
},
reportUnusedDisableDirectives: true,
};
Loading

0 comments on commit e16b4e3

Please sign in to comment.