1
mirror of https://github.com/jakejarvis/eslint-config.git synced 2025-04-26 01:45:25 -04:00

eslint 9.x compatibility

This commit is contained in:
Jake Jarvis 2025-01-16 09:12:29 -05:00
parent f97840fbd8
commit 64cdd08b12
Signed by: jake
SSH Key Fingerprint: SHA256:nCkvAjYA6XaSPUqc4TfbBQTpzr8Xj7ritg/sGInCdkc
4 changed files with 1194 additions and 118 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules/ node_modules/
yarn.lock package-lock.json

217
index.js
View File

@ -1,106 +1,117 @@
/** export default [{
* @type {import("eslint").Linter.Config} languageOptions: {
*/ ecmaVersion: 2018,
module.exports = { sourceType: "module",
extends: [
"eslint:recommended",
],
parserOptions: {
sourceType: "module",
ecmaVersion: 2018, // recommended minimum target, probably overridden by project
}, },
rules: {
// Stylistic:
"brace-style": "error",
"camelcase": ["error", {
properties: "never",
ignoreDestructuring: true,
}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "all"],
"func-call-spacing": "error",
"max-len": ["warn", {
code: 120,
tabWidth: 2,
ignoreComments: false,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: 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-as-needed"],
"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: rules: {
"arrow-body-style": ["error", "as-needed", { "brace-style": "error",
requireReturnForObjectLiteral: false,
}], camelcase: ["error", {
"arrow-parens": ["error", "always"], properties: "never",
"arrow-spacing": ["error", { before: true, after: true }], ignoreDestructuring: true,
"no-confusing-arrow": ["error", { allowParens: true }], }],
"no-var": "error",
"prefer-const": ["error", { "comma-dangle": ["error", "always-multiline"],
destructuring: "any", "comma-spacing": "error",
ignoreReadBeforeAssign: true, "comma-style": "error",
}], curly: ["error", "all"],
"prefer-destructuring": ["error", { "func-call-spacing": "error",
VariableDeclarator: {
array: false, "max-len": ["warn", {
object: true, code: 120,
}, tabWidth: 2,
AssignmentExpression: { ignoreComments: false,
array: true, ignoreUrls: true,
object: false, ignoreStrings: true,
}, ignoreTemplateLiterals: true,
}], ignoreRegExpLiterals: true,
"prefer-rest-params": "error", }],
"prefer-spread": "error",
"template-curly-spacing": "error", "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-as-needed"],
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"],
"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: [ }];
{
// TODO: JS-only config
files: ["*.js"],
},
{
// TODO: TypeScript-only config
files: ["*.ts"],
},
],
};

1076
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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",