mirror of
https://github.com/jakejarvis/eslint-config.git
synced 2025-04-25 15:25:23 -04:00
initial commit 🎉
This commit is contained in:
commit
c7a1481772
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules/
|
19
LICENSE
Normal file
19
LICENSE
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2021 Jake Jarvis
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
28
README.md
Normal file
28
README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# @jakejarvis/eslint-config
|
||||
|
||||
> [Shareable ESLint config](https://eslint.org/docs/developer-guide/shareable-configs.html) inspired heavily by [eslint-config-google](https://github.com/google/eslint-config-google) and moderately by [eslint-config-airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn add --dev eslint @jakejarvis/eslint-config eslint-plugin-compat eslint-plugin-import
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`.eslintrc.json`:
|
||||
|
||||
```json5
|
||||
{
|
||||
"extends": [
|
||||
"@jakejarvis"
|
||||
],
|
||||
"rules": {
|
||||
// Project-specific overrides...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
101
index.js
Normal file
101
index.js
Normal file
@ -0,0 +1,101 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:compat/recommended",
|
||||
"plugin:import/recommended",
|
||||
],
|
||||
parserOptions: {
|
||||
sourceType: "module",
|
||||
ecmaVersion: 2018,
|
||||
ecmaFeatures: {
|
||||
"jsx": true,
|
||||
},
|
||||
},
|
||||
env: {
|
||||
"es6": true,
|
||||
},
|
||||
rules: {
|
||||
// Stylistic:
|
||||
"brace-style": "error",
|
||||
"camelcase": ["error", {
|
||||
"properties": "never",
|
||||
"ignoreDestructuring": true,
|
||||
}],
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"comma-spacing": "error",
|
||||
"comma-style": "error",
|
||||
"curly": ["error", "multi-or-nest", "consistent"],
|
||||
"func-call-spacing": "error",
|
||||
"max-len": ["warn", {
|
||||
"code": 120,
|
||||
"tabWidth": 2,
|
||||
"ignoreUrls": true,
|
||||
"ignoreComments": false,
|
||||
"ignoreStrings": true,
|
||||
"ignoreRegExpLiterals": true,
|
||||
"ignoreTemplateLiterals": 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"],
|
||||
"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",
|
||||
},
|
||||
};
|
47
package.json
Normal file
47
package.json
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@jakejarvis/eslint-config",
|
||||
"version": "0.0.1",
|
||||
"description": "@jakejarvis's shared eslint config.",
|
||||
"license": "MIT",
|
||||
"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": {},
|
||||
"devDependencies": {
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-compat": "^3.13.0",
|
||||
"eslint-plugin-import": "^2.24.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-compat": "^3.13.0",
|
||||
"eslint-plugin-import": "^2.24.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "./index.js",
|
||||
"env": {
|
||||
"node": true
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"eslint",
|
||||
"lint",
|
||||
"config"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user