From 60c945de3010decefc831c2251b4b4373000cce9 Mon Sep 17 00:00:00 2001 From: Damian Legawiec Date: Mon, 8 Jan 2018 22:32:15 +0100 Subject: [PATCH] Replace JSHint and CoffeeLint with ESLint --- .eslintignore | 8 +++ .eslintrc | 67 ++++++++++++++++++++++++ .jshintrc | 34 ------------- coffeelint.json | 133 ------------------------------------------------ 4 files changed, 75 insertions(+), 167 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc delete mode 100644 .jshintrc delete mode 100644 coffeelint.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..8423f366f3 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +**/vendor/** +**/dummy/** +**/sandbox/** +**/guides/output/** +*-min.js +*.min.js +jquery*.js +/guides/content/assets/javascripts/css_browser_selector_dev.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000000..7b58ea1977 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,67 @@ +--- +extends: "eslint-config-airbnb-es5" + +plugins: + - coffeescript + +globals: + Spree: true + analytics: true + ga: true + _: true + Select2: true + Handlebars: true + Raphael: true + +env: + browser: true + jquery: true + +rules: + ### Variables + no-undef: 2 + no-unused-vars: [1, { vars: all, args: none }] + + ### Stylistic issues + indent: [1, 2, { SwitchCase: 1, VariableDeclarator: 2 }] + id-length: [1, { min: 2, exceptions: [_, e, i, k, v] }] + semi: 0 + camelcase: 1 + comma-style: [1, last] + comma-dangle: [1, never] + object-curly-newline: 1 + object-curly-spacing: 1 + prefer-destructuring: 0 + global-require: 1 + eol-last: 1 + quotes: 1 + new-cap: 0 + space-infix-ops: 1 + eqeqeq: 1 + keyword-spacing: 1 + no-redeclare: 1 + space-before-blocks: 1 + brace-style: 1 + space-before-function-paren: 1 + spaced-comment: 1 + padded-blocks: 1 + consistent-return: 1 + one-var: 0 + no-extra-semi: 1 + key-spacing: 1 + dot-notation: 0 + no-shadow: 1 + no-param-reassign: 1 + space-unary-ops: 1 + no-trailing-space: 1 + comma-spacing: 1 + no-inner-declarations: 1 + no-trailing-spaces: 1 + no-implied-eval: 1 + + prefer-template: 1 + function-paren-newline: 1 + no-mixed-operators: 1 + max-len: [1, 150, 2] + arrow-parens: 1 + no-else-return: 1 diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index aa56fa346f..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "asi": false, - "bitwise": true, - "browser": true, - "camelcase": false, - "curly": true, - "forin": true, - "immed": true, - "latedef": "nofunc", - "maxlen": 120, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "predef": [ - "$", - "jQuery", - - "jasmine", - "beforeEach", - "describe", - "expect", - "it", - - "angular", - "inject", - "module", - "Spree" - ], - "quotmark": true, - "trailing": true, - "undef": true, - "unused": true -} diff --git a/coffeelint.json b/coffeelint.json deleted file mode 100644 index b0d88947a9..0000000000 --- a/coffeelint.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "arrow_spacing": { - "level": "ignore" - }, - "braces_spacing": { - "level": "ignore", - "spaces": 0, - "empty_object_spaces": 0 - }, - "camel_case_classes": { - "level": "error" - }, - "coffeescript_error": { - "level": "error" - }, - "colon_assignment_spacing": { - "level": "ignore", - "spacing": { - "left": 0, - "right": 0 - } - }, - "cyclomatic_complexity": { - "level": "ignore", - "value": 10 - }, - "duplicate_key": { - "level": "error" - }, - "empty_constructor_needs_parens": { - "level": "ignore" - }, - "ensure_comprehensions": { - "level": "warn" - }, - "eol_last": { - "level": "ignore" - }, - "indentation": { - "value": 2, - "level": "error" - }, - "line_endings": { - "level": "ignore", - "value": "unix" - }, - "max_line_length": { - "level": "ignore" - }, - "missing_fat_arrows": { - "level": "ignore", - "is_strict": false - }, - "newlines_after_classes": { - "value": 3, - "level": "ignore" - }, - "no_backticks": { - "level": "error" - }, - "no_debugger": { - "level": "warn", - "console": false - }, - "no_empty_functions": { - "level": "ignore" - }, - "no_empty_param_list": { - "level": "ignore" - }, - "no_implicit_braces": { - "level": "ignore", - "strict": true - }, - "no_implicit_parens": { - "level": "ignore", - "strict": true - }, - "no_interpolation_in_single_quotes": { - "level": "ignore" - }, - "no_nested_string_interpolation": { - "level": "warn" - }, - "no_plusplus": { - "level": "ignore" - }, - "no_private_function_fat_arrows": { - "level": "ignore" - }, - "no_stand_alone_at": { - "level": "ignore" - }, - "no_tabs": { - "level": "error" - }, - "no_this": { - "level": "ignore" - }, - "no_throwing_strings": { - "level": "error" - }, - "no_trailing_semicolons": { - "level": "error" - }, - "no_trailing_whitespace": { - "level": "error", - "allowed_in_comments": false, - "allowed_in_empty_lines": true - }, - "no_unnecessary_double_quotes": { - "level": "ignore" - }, - "no_unnecessary_fat_arrows": { - "level": "ignore" - }, - "non_empty_constructor_needs_parens": { - "level": "ignore" - }, - "prefer_english_operator": { - "level": "ignore", - "doubleNotLevel": "ignore" - }, - "space_operators": { - "level": "ignore" - }, - "spacing_after_comma": { - "level": "ignore" - }, - "transform_messes_up_line_numbers": { - "level": "warn" - } -}