Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit e90e0a5

Browse files
author
biped
committed
Upgrade eslint rules according to new agreement
1 parent ce2bae3 commit e90e0a5

File tree

8 files changed

+1249
-245
lines changed

8 files changed

+1249
-245
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 80
10+
trim_trailing_whitespace = true

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# testing
7+
/coverage
8+
9+
# production
10+
/build
11+
12+
# misc
13+
.DS_Store
14+
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*

.npmignore

Whitespace-only changes.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# eslint-config-react-impression
22

3-
ESlint shareable config for React support in javaScript standard style.
3+
[style-guide](https://github.com/NewDadaFE/style-guide)
4+
5+
ESLint shareable config for React/JSX support.
46

57
## Install
68

7-
```
8-
npm i eslint-config-react-impression eslint-plugin-babel eslint-plugin-flow-vars eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react --save-dev
9+
```sh
10+
npm i -D eslint-config-react-impression
911
```
1012

11-
## Examples
13+
## Usage
1214

13-
.babelrc
14-
```javascript
15-
module.exports = {
16-
"extends": "react-impression",
17-
"rules": {
18-
...
19-
}
20-
};
21-
```
15+
Add a file called .babelrc to the project root:
16+
17+
```json
18+
{
19+
"extends": "react-impression"
20+
}
21+
```

index.js

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,12 @@
1-
const inProduction = process.env.NODE_ENV === 'production';
2-
31
module.exports = {
4-
env: {
5-
browser: true,
6-
commonjs: true,
7-
es6: true
8-
},
9-
parser: 'babel-eslint',
10-
plugins: [
11-
'react'
2+
root: true,
3+
parser: 'babel-eslint',
4+
extends: ['standard', 'standard-react'],
5+
rules: {
6+
'space-before-function-paren': [
7+
'error',
8+
{ anonymous: 'always', named: 'never', asyncArrow: 'always' }
129
],
13-
extends: [
14-
'eslint-config-airbnb'
15-
].map(require.resolve),
16-
rules: {
17-
"indent": [
18-
2,
19-
4,
20-
{"VariableDeclarator": 1}
21-
],
22-
"import/prefer-default-export": 0,
23-
"keyword-spacing": 2,
24-
"no-unused-expressions": 0,
25-
"react/no-string-refs": 0,
26-
"react/jsx-filename-extension": [2, { extensions: ['.js'] }],
27-
"react/jsx-closing-bracket-location": 0,
28-
"react/sort-comp": 0,
29-
"react/no-find-dom-node": 0,
30-
"react/jsx-indent-props": [2, 4],
31-
"react/jsx-indent": [2, 4],
32-
"jsx-a11y/img-has-alt": 0,
33-
"jsx-a11y/label-has-for": 0,
34-
"arrow-body-style": 0,
35-
"newline-after-var": 2,
36-
"space-before-function-paren": 0,
37-
"keyword-spacing": 0,
38-
"no-mixed-operators": 0,
39-
"no-underscore-dangle": 0,
40-
"one-var": [
41-
0,
42-
"always"
43-
],
44-
indent: [2, 4, { SwitchCase: 1}],
45-
"no-shadow": 0,
46-
"no-param-reassign": 0,
47-
"prefer-const": 0,
48-
"no-prototype-builtins": 0,
49-
"no-script-url": 0,
50-
"global-require": 0,
51-
"max-len": [2, {"code" : 120}],
52-
'no-debugger': inProduction ? 2 : 0,
53-
'no-console': inProduction ? 2 : 0,
54-
'no-alert': inProduction ? 2 : 0,
55-
}
56-
};
10+
'comma-dangle': ['error', 'always-multiline']
11+
}
12+
}

package-lock.json

Lines changed: 0 additions & 157 deletions
This file was deleted.

package.json

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
{
22
"name": "eslint-config-react-impression",
3-
"version": "1.1.3",
4-
"description": "ESlint shareable config for React support in javaScript standard style.",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"prepublish": "npm config set registry http://registry.npmjs.org",
9-
"postpublish": "npm config set registry https://registry.npm.taobao.org/"
3+
"version": "2.0.0",
4+
"description": "ESLint shareable config for React/JSX support.",
5+
"repository": "NewDadaFE/eslint-config-react-impression",
6+
"license": "MIT",
7+
"engines": {
8+
"node": ">=6"
109
},
11-
"repository": {
12-
"type": "git",
13-
"url": "https://github.com/NewDadaFE/eslint-config-react-impression.git"
10+
"bugs": {
11+
"url": "https://github.com/NewDadaFE/eslint-config-react-impression/issues"
1412
},
1513
"keywords": [
1614
"eslint",
@@ -20,17 +18,15 @@
2018
"javascript",
2119
"eslintconfig"
2220
],
23-
"author": "NewDadaFE",
24-
"license": "MIT",
25-
"bugs": {
26-
"url": "https://github.com/NewDadaFE/eslint-config-react-impression/issues"
27-
},
28-
"homepage": "https://github.com/NewDadaFE/eslint-config-react-impression",
2921
"dependencies": {
30-
"babel-eslint": "*",
31-
"eslint": "*",
32-
"eslint-plugin-import": "*",
33-
"eslint-plugin-react": "*",
34-
"eslint-config-airbnb": "*"
22+
"babel-eslint": "^7.2.3",
23+
"eslint": "^4.5.0",
24+
"eslint-config-standard": "^10.2.1",
25+
"eslint-config-standard-react": "^5.0.0",
26+
"eslint-plugin-import": "^2.7.0",
27+
"eslint-plugin-node": "^5.1.1",
28+
"eslint-plugin-promise": "^3.5.0",
29+
"eslint-plugin-react": "^7.2.1",
30+
"eslint-plugin-standard": "^3.0.1"
3531
}
3632
}

0 commit comments

Comments
 (0)