-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start the process of moving to eslint based tyepscript linting (#3015)
- Move main eslint config to config/eslintrc.json - Convert js to json to help catch syntax errors - Whitelist spacing and a few other minor issues. - Adjust sigh to pass typescript files (and ignore gen/ directories) - Fix sigh to check for directories explicitly - bump lint package versions
- Loading branch information
Showing
16 changed files
with
250 additions
and
183 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
{ | ||
"extends": [ | ||
"./config/eslintrc.json" | ||
] | ||
} |
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,113 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"google" | ||
], | ||
|
||
"parserOptions": { | ||
"ecmaVersion": 2019, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
// Things we do, but probably shouldn't. | ||
"no-console": "off", | ||
"no-throw-literal": "off", | ||
"brace-style": "off", | ||
"camelcase": "off", | ||
"no-unused-vars": "off", | ||
"new-cap": "off", | ||
"arrow-parens": "off", // puts parens around single arg arrow functions | ||
"no-undef": "off", // Particles use importScripts+globals, need to move to JS modules to fix | ||
"no-empty-pattern": "off", // No {} in patterns, but sometimes we use {} to denote an unused argument? | ||
|
||
// eslint-config-google 0.10.0 introduced indent checks | ||
// most projects are opting for prettier instead, so disable | ||
"indent": "off", | ||
|
||
// Things we don't care about. | ||
"require-jsdoc": "off", | ||
"valid-jsdoc": "off", | ||
"quote-props": "off", | ||
"guard-for-in": "off", | ||
"padded-blocks": "off", | ||
"spaced-comment": "off", | ||
"block-spacing": "off", | ||
"no-trailing-spaces": "off", | ||
"eol-last": "off", | ||
"max-len": "off", | ||
"comma-dangle": "off", | ||
"linebreak-style": "off", | ||
"no-multi-spaces": "off", | ||
"keyword-spacing": [1, {"before": true, "after": true}] | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"worker": true, | ||
"mocha": true | ||
}, | ||
"globals": { | ||
// particle implementations | ||
"defineParticle": false, | ||
// tests | ||
"chai": false, | ||
// devtools extension | ||
"chrome": false, | ||
// selenium tests | ||
"browser": false, | ||
|
||
// globals it would be good to figure out how to remove | ||
// - selenium tests | ||
"target": false, | ||
"assert": false, | ||
"pierceShadows": false, | ||
"pierceShadowsSingle": false, | ||
// - extension tests | ||
"filter": false, | ||
"flatten": false, | ||
"deduplicate": false, | ||
"_prepareResults": false, | ||
"extractEntities": false, | ||
// - shell tests | ||
"db": false, | ||
"FakeDatabase": false, | ||
"PersistentArc": false | ||
}, | ||
// Typescript configuration | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.ts"], | ||
"excludedFiles": ["src/gen/**/*.ts"], | ||
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser | ||
"parserOptions": { | ||
// TODO(lindner): For now this option causes severe slowdown. See following issue for updates | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/389 | ||
// and re-enable | ||
// "project": "tsconfig.json" | ||
}, | ||
"rules": { | ||
// eliminate these as usage is cleaned up | ||
"no-invalid-this": "off", | ||
"comma-spacing": "off", | ||
"func-call-spacing": "off", | ||
"generator-star-spacing": "off", | ||
"key-spacing": "off", | ||
"keyword-spacing": "off", | ||
"quotes": "off", | ||
"no-constant-condition": "off", | ||
"no-empty": "off", | ||
"no-extra-boolean-cast": "off", | ||
"no-inner-declarations": "off", | ||
"no-irregular-whitespace": "off", | ||
"no-multiple-empty-lines": "off", | ||
"no-unreachable": "off", | ||
"no-useless-escape": "off", | ||
"object-curly-spacing": "off", | ||
"semi-spacing": "off", | ||
"space-before-blocks": "off", | ||
"space-before-function-paren": "off" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.