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/
yarn.lock
package-lock.json

View File

@ -1,26 +1,23 @@
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
extends: [
"eslint:recommended",
],
parserOptions: {
export default [{
languageOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaVersion: 2018, // recommended minimum target, probably overridden by project
},
rules: {
// Stylistic:
"brace-style": "error",
"camelcase": ["error", {
camelcase: ["error", {
properties: "never",
ignoreDestructuring: true,
}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "all"],
curly: ["error", "all"],
"func-call-spacing": "error",
"max-len": ["warn", {
code: 120,
tabWidth: 2,
@ -30,77 +27,91 @@ module.exports = {
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
}],
"no-multiple-empty-lines": ["error", { max: 1 }],
"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", {
quotes: ["error", "double", {
avoidEscape: true,
allowTemplateLiterals: true,
}],
"semi": "error",
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 }],
"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",
"version": "3.1.0",
"version": "4.0.0",
"description": "My ESLint config. Inspired heavily by eslint-config-google and moderately by eslint-config-airbnb.",
"license": "MIT",
"repository": "jakejarvis/eslint-config",
@ -13,22 +13,11 @@
"index.js"
],
"main": "index.js",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix ."
},
"dependencies": {},
"devDependencies": {
"eslint": "^8.15.0"
"eslint": "^9.4.0"
},
"peerDependencies": {
"eslint": "^7 || >=8"
},
"eslintConfig": {
"extends": "./index.js",
"env": {
"node": true
}
"eslint": "^7 || ^8 || >=9"
},
"keywords": [
"javascript",