-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSLint deprecated and is being replaced by ESLint. Add Vue CLI plugin (@vue/cli-plugin-eslint) using: `vue add @vue/cli-plugin-eslint`. It also adds `.eslintrc.js` manually for Cypress since Vue CLI for ESLint misses it (vuejs/vue-cli#6892). Also rename `npm run lint:vue` to `npm run lint:eslint` for better clarification. This commit disables all rules that the current code is not compliant with. This allows for enabling them gradually and separating commits instead of mixing ESLint introduction with other code changes. AirBnb is chosen as base configuration. "Standard" is not chosen due to its poor defaults. It makes code cleaner but harder to maintain: - It converts interfaces to types which is harder to read. - Removes semicolons that helps to eliminate some ambigious code. "Airbnb" on the other hand helps for easier future changes and maintinability: - Includes more useful rules. - Keeps the semicolons and interfaces. - Enforces trailing commas that makes it easier to delete lines later on. - Delete branches: standard, prettier.
- Loading branch information
1 parent
455084c
commit 61b475f
Showing
20 changed files
with
7,477 additions
and
3,348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[*.{js,jsx,ts,tsx,vue}] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
extends: [ | ||
// Vue specific rules, eslint-plugin-vue | ||
// Added by Vue CLI | ||
'plugin:vue/essential', | ||
|
||
// Extends eslint-config-airbnb | ||
// Added by Vue CLI | ||
// Here until https://github.com/vuejs/eslint-config-airbnb/issues/23 is done | ||
'@vue/airbnb', | ||
|
||
// Extends @typescript-eslint/recommended | ||
// Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
// Added by Vue CLI | ||
'@vue/typescript/recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
rules: { | ||
'no-console': 'off', // process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': 'off', // process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
|
||
'linebreak-style': 'off', | ||
'no-useless-constructor': 'off', | ||
'import/prefer-default-export': 'off', | ||
'class-methods-use-this': 'off', | ||
'no-use-before-define': 'off', | ||
'no-restricted-syntax': 'off', | ||
'global-require': 'off', | ||
'max-len': 'off', | ||
'import/no-unresolved': 'off', | ||
'import/no-webpack-loader-syntax': 'off', | ||
'import/extensions': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'no-plusplus': 'off', | ||
'no-mixed-operators': 'off', | ||
'import/no-extraneous-dependencies': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'no-return-assign': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-shadow': 'off', | ||
'vuejs-accessibility/accessible-emoji': 'off', | ||
'no-promise-executor-return': 'off', | ||
'no-new': 'off', | ||
'no-useless-escape': 'off', | ||
'prefer-destructuring': 'off', | ||
'no-param-reassign': 'off', | ||
'no-irregular-whitespace': 'off', | ||
'no-undef': 'off', | ||
'no-underscore-dangle': 'off', | ||
'vuejs-accessibility/form-control-has-label': 'off', | ||
'vuejs-accessibility/click-events-have-key-events': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'camelcase': 'off', | ||
'no-restricted-globals': 'off', | ||
'default-param-last': 'off', | ||
'no-continue': 'off', | ||
'vuejs-accessibility/anchor-has-content': 'off', | ||
'@typescript-eslint/no-extra-semi': 'off', | ||
'no-multi-spaces': 'off', | ||
'indent': 'off', | ||
'comma-dangle': 'off', | ||
'semi': 'off', | ||
'quotes': 'off', | ||
'key-spacing': 'off', | ||
'lines-between-class-members': 'off', | ||
'import/order': 'off', | ||
'space-in-parens': 'off', | ||
'array-bracket-spacing': 'off', | ||
'object-curly-spacing': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'import/no-duplicates': 'off', | ||
'function-paren-newline': 'off', | ||
'operator-linebreak': 'off', | ||
'no-multiple-empty-lines': 'off', | ||
'object-curly-newline': 'off', | ||
'object-property-newline': 'off', | ||
'arrow-body-style': 'off', | ||
'no-useless-return': 'off', | ||
'prefer-template': 'off', | ||
'func-call-spacing': 'off', | ||
'no-spaced-func': 'off', | ||
'padded-blocks': 'off', | ||
'implicit-arrow-linebreak': 'off', | ||
'function-call-argument-newline': 'off', | ||
'comma-spacing': 'off', | ||
'comma-style': 'off', | ||
'newline-per-chained-call': 'off', | ||
'no-useless-computed-key': 'off', | ||
'no-else-return': 'off', | ||
'quote-props': 'off', | ||
'no-restricted-properties': 'off', | ||
'prefer-exponentiation-operator': 'off', | ||
'semi-spacing': 'off', | ||
'prefer-object-spread': 'off', | ||
'import/newline-after-import': 'off', | ||
'strict': 'off', | ||
'no-trailing-spaces': 'off', | ||
'no-confusing-arrow': 'off', | ||
'eol-last': 'off', | ||
'import/no-useless-path-segments': 'off', | ||
'spaced-comment': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
'**/__tests__/*.{j,t}s?(x)', | ||
'**/tests/unit/**/*.spec.{j,t}s?(x)', | ||
], | ||
env: { | ||
mocha: true, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.