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:
parent
f97840fbd8
commit
64cdd08b12
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
node_modules/
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
|
217
index.js
217
index.js
@ -1,106 +1,117 @@
|
||||
/**
|
||||
* @type {import("eslint").Linter.Config}
|
||||
*/
|
||||
module.exports = {
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
],
|
||||
parserOptions: {
|
||||
sourceType: "module",
|
||||
ecmaVersion: 2018, // recommended minimum target, probably overridden by project
|
||||
export default [{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
},
|
||||
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:
|
||||
"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",
|
||||
rules: {
|
||||
"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"],
|
||||
|
||||
"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
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",
|
||||
"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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user