mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-25 17:51:17 -04:00
much stricter eslint'ing (adapted from eslint-config-google and some airbnb)
This commit is contained in:
104
.eslintrc.json
104
.eslintrc.json
@@ -12,7 +12,7 @@
|
||||
],
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2015,
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"allowImportExportEverywhere": false,
|
||||
"requireConfigFile": false,
|
||||
@@ -24,14 +24,95 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"curly": "error",
|
||||
"quotes": ["error", "double"]
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
// Stylistic:
|
||||
"brace-style": "error",
|
||||
"camelcase": ["error", {
|
||||
"properties": "never",
|
||||
"ignoreDestructuring": true
|
||||
}],
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"comma-spacing": "error",
|
||||
"comma-style": "error",
|
||||
"curly": ["error", "multi-or-nest", "consistent"],
|
||||
"func-call-spacing": "error",
|
||||
// "indent": ["error", 2, {
|
||||
// "ignoredNodes": ["JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXFragment", "JSXOpeningFragment", "JSXClosingFragment", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"]
|
||||
// }],
|
||||
"max-len": ["error", {
|
||||
"code": 100,
|
||||
"tabWidth": 2,
|
||||
"ignoreUrls": true,
|
||||
"ignoreComments": false,
|
||||
"ignoreStrings": true,
|
||||
"ignoreRegExpLiterals": true,
|
||||
"ignoreTemplateLiterals": true
|
||||
}],
|
||||
"no-multiple-empty-lines": ["error", { "max": 1 }],
|
||||
"no-tabs": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"one-var": ["error", {
|
||||
"var": "never",
|
||||
"let": "never",
|
||||
"const": "never"
|
||||
}],
|
||||
"operator-linebreak": ["error", "after"],
|
||||
"padded-blocks": ["error", "never"],
|
||||
"quote-props": ["error", "consistent"],
|
||||
"quotes": ["error", "double", {
|
||||
"avoidEscape": true,
|
||||
"allowTemplateLiterals": true
|
||||
}],
|
||||
"semi": "error",
|
||||
"semi-spacing": "error",
|
||||
"space-before-blocks": "error",
|
||||
"space-before-function-paren": ["error", {
|
||||
"named": "never",
|
||||
"anonymous": "always",
|
||||
"asyncArrow": "always"
|
||||
}],
|
||||
"spaced-comment": ["error", "always", {
|
||||
"line": {
|
||||
"markers": ["/"],
|
||||
"exceptions": ["-", "+"]
|
||||
},
|
||||
"block": {
|
||||
"markers": ["!"],
|
||||
"exceptions": ["*"],
|
||||
"balanced": true
|
||||
}
|
||||
}],
|
||||
"template-tag-spacing": ["error", "never"],
|
||||
|
||||
// ES6:
|
||||
"arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": false }],
|
||||
"arrow-parens": ["error", "always"],
|
||||
"arrow-spacing": ["error", { "before": true, "after": true }],
|
||||
"no-confusing-arrow": ["error", { "allowParens": true }],
|
||||
"no-var": "error",
|
||||
"prefer-const": ["error", {
|
||||
"destructuring": "any",
|
||||
"ignoreReadBeforeAssign": true
|
||||
}],
|
||||
"prefer-destructuring": ["error", {
|
||||
"VariableDeclarator": {
|
||||
"array": false,
|
||||
"object": true
|
||||
},
|
||||
"AssignmentExpression": {
|
||||
"array": true,
|
||||
"object": false
|
||||
}
|
||||
}],
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"template-curly-spacing": "error"
|
||||
},
|
||||
"overrides": [{
|
||||
"files": [
|
||||
"api/**/*.ts"
|
||||
@@ -50,8 +131,6 @@
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module",
|
||||
"project": ["./tsconfig.json"]
|
||||
},
|
||||
"rules": {
|
||||
@@ -59,9 +138,14 @@
|
||||
},
|
||||
"env": {
|
||||
"browser": false,
|
||||
"node": true,
|
||||
"es6": true
|
||||
"node": true
|
||||
}
|
||||
}],
|
||||
"ignorePatterns": ["public/**", "static/assets/**", "postcss.config.js", "gulpfile.js", "webpack.config.js"]
|
||||
"ignorePatterns": [
|
||||
"public/**",
|
||||
"static/assets/**",
|
||||
"*.d.ts",
|
||||
"gulpfile.js",
|
||||
"webpack.config.js"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user