Skip to content

Commit 4d86cfc

Browse files
Initial commit
0 parents  commit 4d86cfc

15 files changed

+336
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.DS_Store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 - First Release
2+
3+
* Initial release

LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Copyright (c) 2018, DopustimVladimir <[email protected]>
2+
3+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4+
5+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
# @dopustim/eslint-config
3+
4+
Configuration file for ESLint
5+
6+
[![NPM](https://img.shields.io/npm/dt/@dopustim/eslint-config.svg?style=flat-square)](https://www.npmjs.com/package/@dopustim/eslint-config)
7+
8+
[![GitHub tag](https://img.shields.io/github/tag/dopustim/eslint-config.svg?style=flat-square)](https://github.com/dopustim/eslint-config/tags)
9+
[![GitHub stars](https://img.shields.io/github/stars/dopustim/eslint-config.svg?style=flat-square)](https://github.com/dopustim/eslint-config/stargazers)
10+
[![GitHub issues](https://img.shields.io/github/issues/dopustim/eslint-config.svg?style=flat-square)](https://github.com/dopustim/eslint-config/issues)
11+
12+
[![License](https://img.shields.io/badge/license-ISC-green.svg?style=flat-square)](/LICENSE.md)
13+
14+
## Features
15+
16+
- Provide Errors and Warnings
17+
- 4 spaces for indentation (warning)
18+
- 100 symbols per line (warning)
19+
- Unix linebreaks (warning)
20+
- Support ES2018
21+
- Support ECMAScript Modules
22+
- No environment
23+
24+
## Usage
25+
26+
Install `@dopustim/eslint-config` package via [NPM](https://www.npmjs.com/package/@dopustim/eslint-config):
27+
28+
```sh
29+
$ npm i -D eslint @dopustim/eslint-config
30+
```
31+
32+
Extend this config in your `.eslintrc.json`:
33+
34+
```json
35+
{
36+
"extends": "@dopustim/eslint-config"
37+
}
38+
```
39+
40+
Or use your `package.json`:
41+
42+
```json
43+
"eslintConfig": {
44+
"extends": "@dopustim/eslint-config"
45+
}
46+
```
47+
48+
You can also set environment and reassign any rule for your needs:
49+
50+
```json
51+
{
52+
"extends": "@dopustim/eslint-config",
53+
"env": {
54+
"node": true
55+
},
56+
"rules": {
57+
"require-jsdoc": 0,
58+
"no-console": 0
59+
}
60+
}
61+
```
62+
63+
## Rules
64+
65+
You can find all rules on [official site](https://eslint.org/docs/rules/).
66+
67+
## License
68+
69+
[ISC License](./LICENSE.md) © 2018 Dopustim Vladimir

index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
3+
parserOptions: {
4+
ecmaVersion: 2018,
5+
sourceType: 'module'
6+
},
7+
extends: [
8+
'./rules/possible-errors.json',
9+
'./rules/best-practices.json',
10+
'./rules/variables.json',
11+
'./rules/nodejs.json',
12+
'./rules/stylistic-issues.json',
13+
'./rules/ecmascript-6.json'
14+
].map(require.resolve)
15+
};

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@dopustim/eslint-config",
3+
"version": "0.1.0",
4+
"description": "Configuration file for ESLint",
5+
"keywords": [
6+
"configuration",
7+
"config",
8+
"json",
9+
"validate",
10+
"lint",
11+
"linter",
12+
"eslint"
13+
],
14+
"author": "DopustimVladimir",
15+
"license": "ISC",
16+
"repository": "https://github.com/dopustim/eslint-config",
17+
"main": "index.js",
18+
"scripts": {
19+
"test": "jasmine spec/index-spec.js"
20+
},
21+
"devDependencies": {
22+
"eslint": "^5.9.0",
23+
"jasmine": "^3.3.0"
24+
},
25+
"eslintConfig": {
26+
"extends": "./index.js",
27+
"env": {
28+
"node": true,
29+
"jasmine": true
30+
}
31+
}
32+
}

rules/best-practices.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"rules": {
3+
"array-callback-return": 2,
4+
"block-scoped-var": 2,
5+
"class-methods-use-this": 2,
6+
"consistent-return": 2,
7+
"default-case": [2, {"commentPattern": "skip default"}],
8+
"dot-location": [2, "object"],
9+
"eqeqeq": [2, "smart"],
10+
"no-alert": 2,
11+
"no-caller": 2,
12+
"no-case-declarations": 2,
13+
"no-empty-function": 1,
14+
"no-empty-pattern": 1,
15+
"no-eval": 2,
16+
"no-extend-native": 1,
17+
"no-extra-bind": 1,
18+
"no-fallthrough": [2, {"commentPattern": "skip break"}],
19+
"no-floating-decimal": 2,
20+
"no-global-assign": 2,
21+
"no-implicit-coercion": 2,
22+
"no-implicit-globals": 1,
23+
"no-implied-eval": 2,
24+
"no-iterator": 2,
25+
"no-lone-blocks": 1,
26+
"no-loop-func": 2,
27+
"no-multi-spaces": 1,
28+
"no-new": 1,
29+
"no-new-func": 1,
30+
"no-new-wrappers": 1,
31+
"no-octal": 2,
32+
"no-octal-escape": 2,
33+
"no-param-reassign": 1,
34+
"no-proto": 2,
35+
"no-redeclare": 2,
36+
"no-return-assign": 2,
37+
"no-return-await": 2,
38+
"no-script-url": 2,
39+
"no-self-assign": 1,
40+
"no-self-compare": 1,
41+
"no-throw-literal": 2,
42+
"no-unmodified-loop-condition": 1,
43+
"no-useless-escape": 1,
44+
"no-useless-return": 2,
45+
"no-warning-comments": 1,
46+
"prefer-promise-reject-errors": 2,
47+
"require-await": 1,
48+
"vars-on-top": 1,
49+
"wrap-iife": [2, "any"]
50+
}
51+
}

rules/ecmascript-6.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"rules": {
3+
"arrow-body-style": [1, "as-needed", {"requireReturnForObjectLiteral": true}],
4+
"arrow-spacing": 1,
5+
"constructor-super": 2,
6+
"generator-star-spacing": [1, "after"],
7+
"no-class-assign": 2,
8+
"no-const-assign": 2,
9+
"no-dupe-class-members": 2,
10+
"no-duplicate-imports": 2,
11+
"no-restricted-imports": [2, {"paths": ["foo-module", "bar-module"]}],
12+
"no-this-before-super": 2,
13+
"no-useless-computed-key": 1,
14+
"no-useless-constructor": 1,
15+
"no-var": 1,
16+
"prefer-const": [1, {"destructuring": "all"}],
17+
"prefer-rest-params": 1,
18+
"prefer-spread": 1,
19+
"prefer-template": 1,
20+
"require-yield": 2,
21+
"template-curly-spacing": [1, "never"],
22+
"yield-star-spacing": [1, "after"]
23+
}
24+
}

rules/nodejs.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"rules": {
3+
"global-require": 2,
4+
"handle-callback-err": 1,
5+
"no-new-require": 2,
6+
"no-path-concat": 1,
7+
"no-process-env": 1,
8+
"no-process-exit": 1,
9+
"no-restricted-modules": [2, {"paths": ["foo-module", "bar-module"]}],
10+
"no-sync": 1
11+
}
12+
}

rules/possible-errors.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"rules": {
3+
"no-console": 1,
4+
"no-control-regex": 1,
5+
"no-dupe-args": 2,
6+
"no-dupe-keys": 2,
7+
"no-duplicate-case": 2,
8+
"no-empty": 1,
9+
"no-empty-character-class": 2,
10+
"no-ex-assign": 2,
11+
"no-extra-parens": 1,
12+
"no-extra-semi": 1,
13+
"no-func-assign": 2,
14+
"no-inner-declarations": 1,
15+
"no-invalid-regexp": 2,
16+
"no-irregular-whitespace": 2,
17+
"no-obj-calls": 2,
18+
"no-regex-spaces": 2,
19+
"no-unexpected-multiline": 1,
20+
"no-unreachable": 2,
21+
"no-unsafe-finally": 2
22+
}
23+
}

0 commit comments

Comments
 (0)