-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) Add ESLint config and clean up the major stuff (#2503)
* (chore) eslint:recommended * (chore): eslint_standard * relax eslint rules for language grammars (to discourage rewriting them in one fell swoop; I'd rather have the blame history intact) * remove extra escaping * clean up variables * more camelcase
- Loading branch information
1 parent
f6813cc
commit 705f49b
Showing
15 changed files
with
1,902 additions
and
198 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,56 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"standard" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"array-callback-return": "error", | ||
"block-scoped-var": "error", | ||
// we like our semi-colons | ||
"semi": ["error","always"], | ||
// our codebase doesn't do this at all, so disabled for now | ||
"space-before-function-paren": ["error","never"], | ||
// for now ignore diff between types of quoting | ||
"quotes": "off", | ||
// this is the style we are already using | ||
"operator-linebreak": ["error","after", { "overrides": { "?": "after", ":": "after" } }], | ||
// sometimes we declare variables with extra spacing | ||
"indent": ["error", 2, {"VariableDeclarator":2}], | ||
// seems like a good idea not to use explicit undefined | ||
"no-undefined": "error", | ||
|
||
// TODO maybe | ||
"camelcase": "off", // TODO: turn on later | ||
"init-declarations": ["error","always"] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/languages/*.js"], | ||
"rules": { | ||
"no-unused-expressions": "off", | ||
// languages are all over the map and we don't want to | ||
// do a mass edit so turn off the most egregious rule violations | ||
"indent": "off", | ||
"comma-dangle": "off", | ||
"array-bracket-spacing": "off", | ||
"object-curly-spacing": "off", | ||
"key-spacing": "off", | ||
"object-curly-newline": "off", | ||
"object-property-newline": "off" | ||
} | ||
} | ||
] | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// whole codebase isn't ES8/9 yet, but our tests and some things are | ||
{ | ||
"esversion": 9, | ||
"node": true | ||
"node": true, | ||
// eslint warns us about semicolons | ||
"-W033": false | ||
} |
Oops, something went wrong.