diff options
author | silverwind <me@silverwind.io> | 2020-03-11 20:34:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 21:34:54 +0200 |
commit | e03d6277698f4e1e03d9336ba017bae130d4353c (patch) | |
tree | 418c84dd378bc86093f9837de80f92c13fe87f68 /.eslintrc | |
parent | 984b85c1a72f9f1561447a8492bc3d33a87e3641 (diff) | |
download | gitea-e03d6277698f4e1e03d9336ba017bae130d4353c.tar.gz gitea-e03d6277698f4e1e03d9336ba017bae130d4353c.zip |
Misc JS linting and naming tweaks (#10652)
- lowercase all js filenames except Vue components
- enable new lint rules, mostly focused on shorter code
- autofix new lint violations
- apply misc transformations indexOf -> includes and onevent-> addEventListener
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to '.eslintrc')
-rw-r--r-- | .eslintrc | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -5,7 +5,7 @@ extends: - eslint:recommended ignorePatterns: - - /web_src/js/vendor + - /web_src/js/vendor parserOptions: ecmaVersion: 2020 @@ -26,19 +26,22 @@ globals: rules: arrow-body-style: [0] + arrow-parens: [2, always] camelcase: [0] comma-dangle: [2, only-multiline] consistent-return: [0] default-case: [0] func-names: [0] - import/extensions: [0] + import/extensions: [2, always, {ignorePackages: true}] import/prefer-default-export: [0] max-len: [0] + multiline-comment-style: [2, separate-lines] newline-per-chained-call: [0] no-alert: [0] no-cond-assign: [2, except-parens] no-console: [1, {allow: [info, warn, error]}] no-continue: [0] + no-eq-null: [2] no-mixed-operators: [0] no-multi-assign: [0] no-new: [0] @@ -49,8 +52,12 @@ rules: no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}] no-use-before-define: [0] no-var: [2] + object-curly-spacing: [2, never] one-var-declaration-per-line: [0] one-var: [0] + operator-linebreak: [2, after] prefer-const: [2, {destructuring: all}] prefer-destructuring: [0] + quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}] radix: [2, as-needed] + semi: [2, always, {omitLastInOneLineBlock: true}] |