Skip to content

Commit

Permalink
Switch over to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Apr 7, 2020
1 parent b89f6e7 commit f8c6977
Show file tree
Hide file tree
Showing 22 changed files with 1,154 additions and 336 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/build
/dist
71 changes: 71 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true
},
extends: [
'eslint:recommended',
],
rules: {
"semi": ["warn", "always"],
"quotes": ["warn", "double"],
"no-constant-condition": ["warn", { checkLoops: false }],
"arrow-parens": ["warn", "as-needed"],
"curly": ["warn", "multi-line", "consistent"],
"indent": ["warn", 2, { SwitchCase: 1 }],
"no-console": ["warn", { allow: ["error", "warn"] }],
"object-shorthand": ["warn", "always", { avoidQuotes: true }],
"quote-props": ["warn", "consistent-as-needed"],
"no-useless-rename": "warn",
"sort-imports": ["warn", {
ignoreDeclarationSort: true
}],
},

overrides: [
{
files: ["rollup.config.js"],
parserOptions: { sourceType: "module" },
},

// The default TS config.
{
files: ["*.ts", "*.tsx"],
parser: '@typescript-eslint/parser',
parserOptions: { project: "tsconfig.json" },
plugins: [
'@typescript-eslint',
],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
"@typescript-eslint/member-delimiter-style": ["warn", {
multiline: { delimiter: "comma" },
singleline: { delimiter: "comma" },
overrides: {
interface: { multiline: { delimiter: "semi" } },
},
}],
"@typescript-eslint/no-inferrable-types": ["warn", {
ignoreParameters: true,
ignoreProperties: true,
}],
"@typescript-eslint/no-empty-function": ["warn", {
allow: ["methods"],
}],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",

"@typescript-eslint/explicit-member-accessibility": ["warn"],

// Use Typescript's unused variable warnings instead
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars-experimental": "warn",
},
},
]
};
Loading

0 comments on commit f8c6977

Please sign in to comment.