Skip to content

Commit

Permalink
Migrate from TSLint to ESLint
Browse files Browse the repository at this point in the history
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
undergroundwires committed Dec 27, 2021
1 parent 8748d00 commit db194b5
Show file tree
Hide file tree
Showing 20 changed files with 7,477 additions and 3,348 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
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
122 changes: 122 additions & 0 deletions .eslintrc.js
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,
},
},
],
};
2 changes: 1 addition & 1 deletion .github/workflows/checks.quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
lint-command:
- npm run lint:vue
- npm run lint:eslint
- npm run lint:yaml
- npm run lint:md
- npm run lint:md:relative-urls
Expand Down
2 changes: 1 addition & 1 deletion img/architecture/gitops.drawio

Large diffs are not rendered by default.

Binary file modified img/architecture/gitops.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db194b5

Please sign in to comment.