Skip to content

Commit 5c42fd3

Browse files
authored
Merge pull request #13 from namics/develop
v4.1.0
2 parents 0756323 + 2f04f5c commit 5c42fd3

File tree

350 files changed

+6247
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+6247
-52
lines changed

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
npm-debug.log
66
node_modules
77
test
8-
processing
8+
bin
99
documentation

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828

2929
####
3030
- [configuration with flowtype](./documentation/with-flow.md)
31+
- [configuration with prettier](./documentation/with-prettier.md)
3132

3233
### .eslintignore
3334
```
File renamed without changes.
File renamed without changes.

processing/write-documentation.js renamed to bin/write-documentation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
55
USAGE
6-
run `node processing/write-documentation.js`
6+
run `node bin/write-documentation.js`
77
88
*/
99

processing/write-rule-test-files.js renamed to bin/write-rule-test-files.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
55
USAGE:
6-
node processing/write-rule-test-files.js rules/flow.js test/flow/rules/
6+
node bin/write-rule-test-files.js rules/flow.js test/flow/rules/
77
88
*/
99

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
3+
extends: [
4+
'./es5-disable-styles.js',
5+
].map(require.resolve),
6+
7+
};

configurations/es5-disable-styles.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
3+
extends: [
4+
'../rules/best-practices-disable-styles.js',
5+
'../rules/errors-disable-styles.js',
6+
'../rules/style-disable-styles.js',
7+
'../rules/variables-disable-styles.js',
8+
].map(require.resolve),
9+
10+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
3+
extends: [
4+
'./es5-disable-styles.js',
5+
'../rules/node-disable-styles.js',
6+
].map(require.resolve),
7+
8+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
3+
extends: [
4+
'./es6-disable-styles.js',
5+
].map(require.resolve),
6+
7+
};

configurations/es6-disable-styles.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
3+
extends: [
4+
'../rules/best-practices-disable-styles.js',
5+
'../rules/errors-disable-styles.js',
6+
'../rules/style-disable-styles.js',
7+
'../rules/variables-disable-styles.js',
8+
'../rules/imports-disable-styles.js',
9+
'../rules/es6-disable-styles.js',
10+
].map(require.resolve),
11+
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
3+
extends: [
4+
'./es6-disable-styles.js',
5+
'../rules/node-disable-styles.js',
6+
].map(require.resolve),
7+
8+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
'extends': [
3+
'./es6-disable-styles.js',
4+
'../rules/react-disable-styles.js',
5+
'../rules/react-a11y-disable-styles.js',
6+
].map(require.resolve),
7+
8+
};

configurations/flow-disable-styles.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
module.exports = {
3+
4+
'extends': [
5+
'../rules/flow-disable-styles.js',
6+
].map(require.resolve),
7+
8+
};

configurations/flow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
],
88
'extends': [
99
'../rules/flow.js',
10-
],
10+
].map(require.resolve),
1111
'settings': {
1212
'flowtype': {
1313
'onlyFilesWithFlowAnnotation': true,

documentation/with-flow.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### with flow
1+
## with flow
22
Flowtype rules will be accepted if the flow annotation was defined in first line of each file.
33
```
44
module.exports = {

documentation/with-prettier.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## with prettier
2+
3+
### ES6 + Prettier
4+
```
5+
module.exports = {
6+
"extends": [
7+
"@namics/eslint-config/configurations/es6-browser.js",
8+
"@namics/eslint-config/configurations/es6-browser-disable-styles.js"
9+
]
10+
};
11+
```
12+
13+
### ES6 + React + Prettier
14+
```
15+
module.exports = {
16+
"extends": [
17+
"@namics/eslint-config/configurations/es6-react.js",
18+
"@namics/eslint-config/configurations/es6-react-disable-styles.js"
19+
]
20+
};
21+
```
22+
23+
### ES6 + React + Flow + Prettier
24+
```
25+
module.exports = {
26+
"extends": [
27+
"@namics/eslint-config/configurations/es6-react.js",
28+
"@namics/eslint-config/configurations/es6-react-disable-styles.js",
29+
"@namics/eslint-config/configurations/flow.js",
30+
"@namics/eslint-config/configurations/flow-disable-styles.js"
31+
]
32+
};
33+
```

package.json

+54-45
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,57 @@
11
{
2-
"name": "@namics/eslint-config",
3-
"version": "4.0.0",
4-
"description": "Default configurations for eslint",
5-
"author": "Simon Mollweide <[email protected]>",
6-
"license": "MIT",
7-
"private": false,
8-
"engines": {
9-
"node": ">=4 <9",
10-
"npm": ">=3 <6"
2+
"name": "@namics/eslint-config",
3+
"version": "4.1.0",
4+
"description": "Default configurations for eslint",
5+
"author": "Simon Mollweide <[email protected]>",
6+
"license": "MIT",
7+
"private": false,
8+
"engines": {
9+
"node": ">=4 <9",
10+
"npm": ">=3 <6"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/namics/eslint-config-namics.git"
15+
},
16+
"bugs": {
17+
"url": "https://github.com/namics/eslint-config-namics/issues"
18+
},
19+
"main": "configurations/es6-browser.js",
20+
"scripts": {
21+
"lint": "npm run lint:js",
22+
"lint:js": "node_modules/.bin/eslint .",
23+
"test": "npm run lint",
24+
"prettier": "npm run prettier:es5 && npm run prettier:es5node && npm run prettier:es6 && npm run prettier:es6react && npm run prettier:flow",
25+
"prettier:es5": "node_modules/.bin/prettier --write \"test/es5-disable-styles/**/*.js\"",
26+
"prettier:es5node": "node_modules/.bin/prettier --write \"test/es5-node-disable-styles/**/*.js\"",
27+
"prettier:es6": "node_modules/.bin/prettier --write \"test/es6-disable-styles/**/*.js\"",
28+
"prettier:es6react": "node_modules/.bin/prettier --write \"test/es6-react-disable-styles/**/*.js\"",
29+
"prettier:flow": "node_modules/.bin/prettier --write \"test/flow-disable-styles/**/*.js\""
30+
},
31+
"keywords": [
32+
"code checker",
33+
"code linter",
34+
"code standards",
35+
"code style",
36+
"eslint-config",
37+
"eslint",
38+
"eslintconfig",
39+
"lint",
40+
"es2015",
41+
"react",
42+
"jsx"
43+
],
44+
"devDependencies": {
45+
"prettier": "^1.5.3"
1146
},
12-
"repository": {
13-
"type": "git",
14-
"url": "https://github.com/namics/eslint-config-namics.git"
15-
},
16-
"bugs": {
17-
"url": "https://github.com/namics/eslint-config-namics/issues"
18-
},
19-
"main": "configurations/es6-browser.js",
20-
"scripts": {
21-
"lint": "npm run lint:js",
22-
"lint:js": "node_modules/.bin/eslint .",
23-
"test": "npm run lint"
24-
},
25-
"keywords": [
26-
"code checker",
27-
"code linter",
28-
"code standards",
29-
"code style",
30-
"eslint-config",
31-
"eslint",
32-
"eslintconfig",
33-
"lint",
34-
"es2015",
35-
"react",
36-
"jsx"
37-
],
38-
"dependencies": {
39-
"babel-eslint": "7.2.3",
40-
"eslint": "4.2.0",
41-
"eslint-find-rules": "3.1.1",
42-
"eslint-plugin-flowtype": "2.35.0",
43-
"eslint-plugin-import": "2.7.0",
44-
"eslint-plugin-jsx-a11y": "6.0.2",
45-
"eslint-plugin-react": "7.1.0",
46-
"flow-bin": "0.50.0"
47-
}
47+
"dependencies": {
48+
"babel-eslint": "7.2.3",
49+
"eslint": "4.2.0",
50+
"eslint-find-rules": "3.1.1",
51+
"eslint-plugin-flowtype": "2.35.0",
52+
"eslint-plugin-import": "2.7.0",
53+
"eslint-plugin-jsx-a11y": "6.0.2",
54+
"eslint-plugin-react": "7.1.0",
55+
"flow-bin": "0.50.0"
56+
}
4857
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* global module */
2+
/* not yet approved by skill group core team */
3+
module.exports = {
4+
rules: {
5+
// specify curly brace conventions for all control statements
6+
'curly': 0,
7+
8+
// enforces consistent newlines before or after dots
9+
'dot-location': 0,
10+
11+
// disallow lexical declarations in case/default clauses
12+
// http://eslint.org/docs/rules/no-case-declarations.html
13+
'no-case-declarations': 0,
14+
15+
// disallow the use of leading or trailing decimal points in numeric literals
16+
'no-floating-decimal': 0,
17+
18+
// disallow use of multiple spaces
19+
'no-multi-spaces': 0,
20+
21+
// disallow use of multiline strings
22+
'no-multi-str': 0,
23+
},
24+
};

rules/errors-disable-styles.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* global module */
2+
/* not yet approved by skill group core team */
3+
module.exports = {
4+
rules: {
5+
// require trailing commas in multiline object literals
6+
'comma-dangle': 0,
7+
8+
// disallow unnecessary semicolons
9+
'no-extra-semi': 0,
10+
11+
// disallow irregular whitespace outside of strings and comments
12+
'no-irregular-whitespace': 0,
13+
14+
// Avoid code that looks like two expressions but is actually one
15+
'no-unexpected-multiline': 0,
16+
},
17+
};

rules/es6-disable-styles.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* global module */
2+
/* not yet approved by skill group core team */
3+
module.exports = {
4+
rules: {
5+
// enforces no braces where they can be omitted
6+
// http://eslint.org/docs/rules/arrow-body-style
7+
'arrow-body-style': 0,
8+
9+
// require parens in arrow function arguments
10+
'arrow-parens': 0,
11+
12+
// require space before/after arrow function's arrow
13+
// http://eslint.org/docs/rules/arrow-spacing
14+
'arrow-spacing': 0,
15+
16+
// enforce the spacing around the * in generator functions
17+
// http://eslint.org/docs/rules/generator-star-spacing
18+
'generator-star-spacing': 0,
19+
20+
// disallow arrow functions where they could be confused with comparisons
21+
// http://eslint.org/docs/rules/no-confusing-arrow
22+
'no-confusing-arrow': 0,
23+
24+
// enforce usage of spacing in template strings
25+
// http://eslint.org/docs/rules/template-curly-spacing
26+
'template-curly-spacing': 0,
27+
28+
// enforce spacing around the * in yield* expressions
29+
// http://eslint.org/docs/rules/yield-star-spacing
30+
'yield-star-spacing': 0,
31+
},
32+
};

rules/flow-disable-styles.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* eslint-disable */
2+
/* global module */
3+
/* not yet approved by skill group core team */
4+
module.exports = {
5+
rules: {
6+
7+
8+
// enforces consistent use of trailing commas in Object and Tuple annotations.
9+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-delimiter-dangle
10+
'flowtype/delimiter-dangle': 0,
11+
12+
// enforces consistent separators between properties in Flow object types.
13+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter
14+
'flowtype/object-type-delimiter': 0,
15+
16+
// enforces consistent use of semicolons after type aliases.
17+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-semi
18+
'flowtype/semi': 0,
19+
20+
// enforces consistent spacing after the type annotation colon.
21+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-after-type-colon
22+
'flowtype/space-after-type-colon': 0,
23+
24+
// Enforces consistent spacing before the opening < of generic type annotation parameters.
25+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-before-generic-bracket
26+
'flowtype/space-before-generic-bracket': 0,
27+
28+
// Enforces consistent spacing before the type annotation colon.
29+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-space-before-type-colon
30+
'flowtype/space-before-type-colon': 0,
31+
32+
// Enforces consistent spacing around union and intersection type separators (| and &).
33+
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-union-intersection-spacing
34+
'flowtype/union-intersection-spacing': 0,
35+
},
36+
};

rules/flow.js

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ module.exports = {
77
// Overwrite require-jsdoc rule
88
'require-jsdoc': 0,
99

10+
// disallow importing from the same path more than once
11+
// http://eslint.org/docs/rules/no-duplicate-imports
12+
'no-duplicate-imports': 0,
13+
14+
// disallow duplicate imports
15+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
16+
'import/no-duplicates': 0,
17+
18+
// Prevent missing props validation in a React component definition
19+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
20+
'react/prop-types': 0,
21+
1022
// enforces a particular style for boolean type annotations. This rule takes one argument.
1123
// https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-boolean-style
1224
'flowtype/boolean-style': [2, 'boolean'],

0 commit comments

Comments
 (0)