This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
chore(*): switch from JSHint/JSCS to ESLint
Thanks to @Narretz for help in fixing style violations and to @gkalpak for a very extensive review. Closes #14952
- Loading branch information
Showing
308 changed files
with
6,562 additions
and
5,807 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,11 @@ | ||
bower_components/** | ||
build/** | ||
docs/bower_components/** | ||
docs/app/assets/js/angular-bootstrap/** | ||
docs/config/templates/** | ||
node_modules/** | ||
lib/htmlparser/** | ||
src/angular.bind.js | ||
src/ngParseExt/ucd.js | ||
i18n/closure/** | ||
tmp/** |
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,116 @@ | ||
{ | ||
"rules": { | ||
// Rules are divided into sections from http://eslint.org/docs/rules/ | ||
|
||
// Possible errors | ||
"comma-dangle": ["error", "never"], | ||
"no-cond-assign": ["error", "except-parens"], | ||
"no-constant-condition": ["error", {"checkLoops": false}], | ||
"no-control-regex": "error", | ||
"no-debugger": "error", | ||
"no-dupe-args": "error", | ||
"no-dupe-keys": "error", | ||
"no-duplicate-case": "error", | ||
"no-empty-character-class": "error", | ||
"no-empty": "error", | ||
"no-ex-assign": "error", | ||
"no-extra-boolean-cast": "error", | ||
"no-extra-semi": "error", | ||
"no-func-assign": "error", | ||
"no-inner-declarations": "error", | ||
"no-invalid-regexp": "error", | ||
"no-irregular-whitespace": "error", | ||
"no-negated-in-lhs": "error", | ||
"no-obj-calls": "error", | ||
"no-regex-spaces": "error", | ||
"no-sparse-arrays": "error", | ||
"no-unreachable": "error", | ||
"use-isnan": "error", | ||
"no-unsafe-finally": "error", | ||
"valid-typeof": "error", | ||
"no-unexpected-multiline": "error", | ||
|
||
// Best practices | ||
"accessor-pairs": "error", | ||
"array-callback-return": "error", | ||
"eqeqeq": ["error", "allow-null"], | ||
"no-alert": "error", | ||
"no-caller": "error", | ||
"no-case-declarations": "error", | ||
"no-eval": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "error", | ||
"no-extra-label": "error", | ||
"no-fallthrough": "error", | ||
"no-floating-decimal": "error", | ||
"no-implied-eval": "error", | ||
"no-invalid-this": "error", | ||
"no-iterator": "error", | ||
"no-multi-str": "error", | ||
"no-new-func": "error", | ||
"no-new-wrappers": "error", | ||
"no-new": "error", | ||
"no-octal-escape": "error", | ||
"no-octal": "error", | ||
"no-proto": "error", | ||
"no-redeclare": "error", | ||
"no-return-assign": "error", | ||
"no-script-url": "error", | ||
"no-self-assign": "error", | ||
"no-self-compare": "error", | ||
"no-sequences": "error", | ||
"no-throw-literal": "error", | ||
"no-unmodified-loop-condition": "error", | ||
"no-unused-expressions": "error", | ||
"no-unused-labels": "error", | ||
"no-useless-call": "error", | ||
"no-useless-concat": "error", | ||
"no-useless-escape": "error", | ||
"no-void": "error", | ||
"no-with": "error", | ||
"radix": "error", | ||
"wrap-iife": ["error", "inside"], | ||
|
||
// Strict mode | ||
"strict": ["error", "global"], | ||
|
||
// Variables | ||
"no-delete-var": "error", | ||
"no-label-var": "error", | ||
"no-restricted-globals": ["error", "event"], | ||
"no-shadow-restricted-names": "error", | ||
"no-undef-init": "error", | ||
"no-undef": "error", | ||
"no-unused-vars": ["error", { "vars": "local", "args": "none" }], | ||
|
||
// Node.js | ||
"handle-callback-err": "error", | ||
|
||
// Stylistic issues | ||
"array-bracket-spacing": ["error", "never"], | ||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"comma-style": ["error", "last"], | ||
"eol-last": "error", | ||
"keyword-spacing": "error", | ||
"linebreak-style": ["error", "unix"], | ||
"max-len": ["error", { "code": 200, "ignoreComments": true, "ignoreUrls": true }], | ||
"new-cap": "error", | ||
"new-parens": "error", | ||
"no-array-constructor": "error", | ||
"no-bitwise": "error", | ||
"no-mixed-spaces-and-tabs": "error", | ||
"no-multiple-empty-lines": ["error", { "max": 3, "maxEOF": 1 }], | ||
"no-whitespace-before-property": "error", | ||
"no-spaced-func": "error", | ||
"no-trailing-spaces": "error", | ||
"no-unneeded-ternary": "error", | ||
"semi-spacing": "error", | ||
"semi": "error", | ||
"space-before-blocks": ["error", "always"], | ||
"space-before-function-paren": ["error", "never"], | ||
"space-in-parens": ["error", "never"], | ||
"space-infix-ops": "error", | ||
"space-unary-ops": ["error", { "words": true, "nonwords": false }], | ||
"unicode-bom": ["error", "never"] | ||
} | ||
} |
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,17 @@ | ||
{ | ||
"extends": "./.eslintrc-base.json", | ||
|
||
"env": { | ||
// Note: don't set `"browser": true`; code in "src/" should be compatible with | ||
// non-browser environments like Node.js with a custom window implementation | ||
// like jsdom. All browser globals should be taken from window. | ||
"browser": false, | ||
"node": false | ||
}, | ||
|
||
"globals": { | ||
"window": false, | ||
|
||
"angular": false | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"extends": "./.eslintrc-base.json", | ||
|
||
"env": { | ||
"browser": false, | ||
"node": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
// This config contains proposed rules that we'd like to have enabled but haven't | ||
// converted the code to adhere yet. If a decision comes to not enable one of these | ||
// rules, it should be removed from the file. Every rule that got enabled in the | ||
// end should be moved from here to a respective section in .eslintrc.json | ||
|
||
"rules": { | ||
// Rules are divided into sections from http://eslint.org/docs/rules/ | ||
|
||
// Best practices | ||
"complexity": ["error", 10], | ||
"dot-notation": "error", | ||
"dot-location": ["error", "property"], | ||
|
||
// Stylistic issues | ||
"block-spacing": ["error", "always"], | ||
"comma-spacing": "error", | ||
"id-blacklist": ["error", "event"], | ||
"indent": ["error", 2], | ||
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }], | ||
"object-curly-spacing": ["error", "never"], | ||
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }], | ||
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}], | ||
"quotes": ["error", "single"] | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"root": true, | ||
"extends": "./.eslintrc-node.json" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.