mirror of
https://github.com/jakejarvis/eslint-config.git
synced 2025-04-26 05:15:24 -04:00
eslint 9.x compatibility
This commit is contained in:
parent
f97840fbd8
commit
64cdd08b12
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
yarn.lock
|
package-lock.json
|
||||||
|
69
index.js
69
index.js
@ -1,26 +1,23 @@
|
|||||||
/**
|
export default [{
|
||||||
* @type {import("eslint").Linter.Config}
|
languageOptions: {
|
||||||
*/
|
ecmaVersion: 2018,
|
||||||
module.exports = {
|
|
||||||
extends: [
|
|
||||||
"eslint:recommended",
|
|
||||||
],
|
|
||||||
parserOptions: {
|
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
ecmaVersion: 2018, // recommended minimum target, probably overridden by project
|
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
// Stylistic:
|
|
||||||
"brace-style": "error",
|
"brace-style": "error",
|
||||||
"camelcase": ["error", {
|
|
||||||
|
camelcase: ["error", {
|
||||||
properties: "never",
|
properties: "never",
|
||||||
ignoreDestructuring: true,
|
ignoreDestructuring: true,
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
"comma-dangle": ["error", "always-multiline"],
|
||||||
"comma-spacing": "error",
|
"comma-spacing": "error",
|
||||||
"comma-style": "error",
|
"comma-style": "error",
|
||||||
"curly": ["error", "all"],
|
curly: ["error", "all"],
|
||||||
"func-call-spacing": "error",
|
"func-call-spacing": "error",
|
||||||
|
|
||||||
"max-len": ["warn", {
|
"max-len": ["warn", {
|
||||||
code: 120,
|
code: 120,
|
||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
@ -30,77 +27,91 @@ module.exports = {
|
|||||||
ignoreTemplateLiterals: true,
|
ignoreTemplateLiterals: true,
|
||||||
ignoreRegExpLiterals: true,
|
ignoreRegExpLiterals: true,
|
||||||
}],
|
}],
|
||||||
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
||||||
|
"no-multiple-empty-lines": ["error", {
|
||||||
|
max: 1,
|
||||||
|
}],
|
||||||
|
|
||||||
"no-tabs": "error",
|
"no-tabs": "error",
|
||||||
"no-trailing-spaces": "error",
|
"no-trailing-spaces": "error",
|
||||||
"object-curly-spacing": ["error", "always"],
|
"object-curly-spacing": ["error", "always"],
|
||||||
|
|
||||||
"one-var": ["error", {
|
"one-var": ["error", {
|
||||||
var: "never",
|
var: "never",
|
||||||
let: "never",
|
let: "never",
|
||||||
const: "never",
|
const: "never",
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"operator-linebreak": ["error", "after"],
|
"operator-linebreak": ["error", "after"],
|
||||||
"padded-blocks": ["error", "never"],
|
"padded-blocks": ["error", "never"],
|
||||||
"quote-props": ["error", "consistent-as-needed"],
|
"quote-props": ["error", "consistent-as-needed"],
|
||||||
"quotes": ["error", "double", {
|
|
||||||
|
quotes: ["error", "double", {
|
||||||
avoidEscape: true,
|
avoidEscape: true,
|
||||||
allowTemplateLiterals: true,
|
allowTemplateLiterals: true,
|
||||||
}],
|
}],
|
||||||
"semi": "error",
|
|
||||||
|
semi: "error",
|
||||||
"semi-spacing": "error",
|
"semi-spacing": "error",
|
||||||
"space-before-blocks": "error",
|
"space-before-blocks": "error",
|
||||||
|
|
||||||
"space-before-function-paren": ["error", {
|
"space-before-function-paren": ["error", {
|
||||||
named: "never",
|
named: "never",
|
||||||
anonymous: "always",
|
anonymous: "always",
|
||||||
asyncArrow: "always",
|
asyncArrow: "always",
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"spaced-comment": ["error", "always", {
|
"spaced-comment": ["error", "always", {
|
||||||
line: {
|
line: {
|
||||||
markers: ["/"],
|
markers: ["/"],
|
||||||
exceptions: ["-", "+"],
|
exceptions: ["-", "+"],
|
||||||
},
|
},
|
||||||
|
|
||||||
block: {
|
block: {
|
||||||
markers: ["!"],
|
markers: ["!"],
|
||||||
exceptions: ["*"],
|
exceptions: ["*"],
|
||||||
balanced: true,
|
balanced: true,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"template-tag-spacing": ["error", "never"],
|
"template-tag-spacing": ["error", "never"],
|
||||||
|
|
||||||
// ES6:
|
|
||||||
"arrow-body-style": ["error", "as-needed", {
|
"arrow-body-style": ["error", "as-needed", {
|
||||||
requireReturnForObjectLiteral: false,
|
requireReturnForObjectLiteral: false,
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"arrow-parens": ["error", "always"],
|
"arrow-parens": ["error", "always"],
|
||||||
"arrow-spacing": ["error", { before: true, after: true }],
|
|
||||||
"no-confusing-arrow": ["error", { allowParens: true }],
|
"arrow-spacing": ["error", {
|
||||||
|
before: true,
|
||||||
|
after: true,
|
||||||
|
}],
|
||||||
|
|
||||||
|
"no-confusing-arrow": ["error", {
|
||||||
|
allowParens: true,
|
||||||
|
}],
|
||||||
|
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
|
||||||
"prefer-const": ["error", {
|
"prefer-const": ["error", {
|
||||||
destructuring: "any",
|
destructuring: "any",
|
||||||
ignoreReadBeforeAssign: true,
|
ignoreReadBeforeAssign: true,
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"prefer-destructuring": ["error", {
|
"prefer-destructuring": ["error", {
|
||||||
VariableDeclarator: {
|
VariableDeclarator: {
|
||||||
array: false,
|
array: false,
|
||||||
object: true,
|
object: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
AssignmentExpression: {
|
AssignmentExpression: {
|
||||||
array: true,
|
array: true,
|
||||||
object: false,
|
object: false,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
|
||||||
"prefer-rest-params": "error",
|
"prefer-rest-params": "error",
|
||||||
"prefer-spread": "error",
|
"prefer-spread": "error",
|
||||||
"template-curly-spacing": "error",
|
"template-curly-spacing": "error",
|
||||||
},
|
},
|
||||||
overrides: [
|
}];
|
||||||
{
|
|
||||||
// TODO: JS-only config
|
|
||||||
files: ["*.js"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// TODO: TypeScript-only config
|
|
||||||
files: ["*.ts"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
1076
package-lock.json
generated
Normal file
1076
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@jakejarvis/eslint-config",
|
"name": "@jakejarvis/eslint-config",
|
||||||
"version": "3.1.0",
|
"version": "4.0.0",
|
||||||
"description": "My ESLint config. Inspired heavily by eslint-config-google and moderately by eslint-config-airbnb.",
|
"description": "My ESLint config. Inspired heavily by eslint-config-google and moderately by eslint-config-airbnb.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": "jakejarvis/eslint-config",
|
"repository": "jakejarvis/eslint-config",
|
||||||
@ -13,22 +13,11 @@
|
|||||||
"index.js"
|
"index.js"
|
||||||
],
|
],
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"lint:fix": "eslint --fix ."
|
|
||||||
},
|
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.15.0"
|
"eslint": "^9.4.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^7 || >=8"
|
"eslint": "^7 || ^8 || >=9"
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"extends": "./index.js",
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"javascript",
|
"javascript",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user