Skip to content

Commit

Permalink
Start the process of moving to eslint based tyepscript linting (#3015)
Browse files Browse the repository at this point in the history
- 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
lindner committed May 15, 2019
1 parent 61a46a2 commit ecca50d
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 183 deletions.
76 changes: 0 additions & 76 deletions .eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"./config/eslintrc.json"
]
}
113 changes: 113 additions & 0 deletions config/eslintrc.json
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"
}
}
]
}
Loading

0 comments on commit ecca50d

Please sign in to comment.