1
mirror of https://github.com/jakejarvis/eslint-config.git synced 2025-04-28 06:50:30 -04:00

Compare commits

...

14 Commits
v1.1.1 ... main

Author SHA1 Message Date
29be6e9c26
lint again 2025-01-16 10:47:56 -05:00
5ed0ff58f6
fix operator-linebreak again 2025-01-16 10:47:06 -05:00
b5c20f22a2
lint the linter config 2025-01-16 10:43:53 -05:00
a56231d6a4
fix operator-linebreak 2025-01-16 10:43:11 -05:00
ed541485b3
fix some rules 2025-01-16 10:41:11 -05:00
fcb55a20bd
remove languageOptions 2025-01-16 10:11:19 -05:00
86a3091d71
add missing "type": "module" 2025-01-16 09:15:28 -05:00
64cdd08b12
eslint 9.x compatibility 2025-01-16 09:12:29 -05:00
f97840fbd8
v3.1.0 2022-05-10 20:05:58 -04:00
58062a0bc0
remove optional peerDependencies 2022-05-10 20:01:37 -04:00
cbe2b1e5fa
v3.0.0 2021-11-17 14:17:43 -05:00
9ba98bac80
bump plugin versions 2021-11-17 12:04:39 -05:00
02f185c144
v2.0.0 2021-10-12 20:00:30 -04:00
98810d0f43
make plugin-compat/import optional peer deps 2021-10-12 19:59:00 -04:00
4 changed files with 1184 additions and 129 deletions

2
.gitignore vendored
View File

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

205
index.js
View File

@ -1,109 +1,104 @@
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:compat/recommended",
"plugin:import/recommended",
],
parserOptions: {
sourceType: "module",
ecmaVersion: 2018, // recommended minimum target, probably overridden by project
},
export default [{
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"],
"brace-style": "error",
// 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",
camelcase: ["error", {
properties: "never",
ignoreDestructuring: true,
}],
// Plugins
"compat/compat": "off", // override locally for browser-targeted projects
"comma-dangle": ["error", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "never",
}],
"comma-spacing": "error",
"comma-style": "error",
curly: ["error", "multi-line"],
"func-call-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", { overrides: { "?": "before", ":": "before" } }],
"padded-blocks": ["error", "never"],
"quote-props": ["error", "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-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", "*.tsx", "*.d.ts"],
},
],
};
}];

1076
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,24 @@
{
"name": "@jakejarvis/eslint-config",
"version": "1.1.1",
"version": "4.0.7",
"description": "My ESLint config. Inspired heavily by eslint-config-google and moderately by eslint-config-airbnb.",
"license": "MIT",
"repository": "jakejarvis/eslint-config",
"author": {
"name": "Jake Jarvis",
"email": "jake@jarv.is",
"url": "https://jarv.is/"
},
"repository": {
"type": "git",
"url": "https://github.com/jakejarvis/eslint-config.git"
},
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix ."
},
"dependencies": {
"eslint-plugin-compat": "~3.13.0",
"eslint-plugin-import": "~2.25.2"
"main": "index.js",
"type": "module",
"devDependencies": {
"eslint": "^9.4.0"
},
"peerDependencies": {
"eslint": "^7 || >=8"
},
"devDependencies": {
"eslint": "^8.0.0"
},
"eslintConfig": {
"extends": "./index.js",
"env": {
"node": true
}
"eslint": "^7 || ^8 || >=9"
},
"keywords": [
"javascript",