Skip to content

Commit 23566d6

Browse files
committed
Add support for eslint-plugin-standard
Fixes #29.
1 parent 9a78202 commit 23566d6

File tree

6 files changed

+37
-7
lines changed

6 files changed

+37
-7
lines changed

.eslintrc.base.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports = {
2929
"prettier/prettier": ["error", {}],
3030
// Force a conflict with Prettier in test-lint/flowtype.js.
3131
"flowtype/object-type-delimiter": ["error", "semicolon"],
32-
"react/jsx-filename-extension": "off"
32+
"react/jsx-filename-extension": "off",
33+
// Force a conflict with Prettier in test-lint/standard.js.
34+
"standard/computed-property-even-spacing": ["error", "even"]
3335
}
3436
};

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ A few ESLint plugins are supported as well:
3232

3333
- [eslint-plugin-flowtype]
3434
- [eslint-plugin-react]
35+
- [eslint-plugin-standard]
3536

3637
Add extra exclusions for the plugins you use like so:
3738

@@ -40,7 +41,8 @@ Add extra exclusions for the plugins you use like so:
4041
"extends": [
4142
"prettier",
4243
"prettier/flowtype",
43-
"prettier/react"
44+
"prettier/react",
45+
"prettier/standard"
4446
]
4547
}
4648
```
@@ -76,20 +78,21 @@ Exit codes:
7678
```json
7779
{
7880
"extends": [
79-
"google",
81+
"standard",
8082
"plugin:flowtype/recommended",
8183
"plugin:react/recommended",
8284
"prettier",
8385
"prettier/flowtype",
84-
"prettier/react"
86+
"prettier/react",
87+
"prettier/standard"
8588
],
8689
"plugins": [
8790
"flowtype",
8891
"react",
89-
"prettier"
92+
"prettier",
93+
"standard"
9094
],
9195
"parserOptions": {
92-
"ecmaVersion": 2016,
9396
"sourceType": "module",
9497
"ecmaFeatures": {
9598
"jsx": true
@@ -324,6 +327,7 @@ eslint-config-prettier has been tested with:
324327
- prettier 1.7.0
325328
- eslint-plugin-flowtype 2.35.1
326329
- eslint-plugin-react 7.3.0
330+
- eslint-plugin-standard 3.0.1
327331

328332
Have new rules been added since those versions? Have we missed any rules? Is
329333
there a plugin you would like to see exclusions for? Open an issue or a pull
@@ -392,6 +396,7 @@ several other npm scripts:
392396
[eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype
393397
[eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier
394398
[eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react
399+
[eslint-plugin-standard]: https://github.com/xjamundx/eslint-plugin-standard
395400
[max-len]: http://eslint.org/docs/rules/max-len
396401
[no-confusing-arrow]: http://eslint.org/docs/rules/no-confusing-arrow
397402
[no-mixed-operators]: http://eslint.org/docs/rules/no-mixed-operators

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"bin/",
1010
"flowtype.js",
1111
"index.js",
12-
"react.js"
12+
"react.js",
13+
"standard.js"
1314
],
1415
"bin": {
1516
"eslint-config-prettier-check": "bin/cli.js"
@@ -39,6 +40,7 @@
3940
"eslint-plugin-flowtype": "^2.35.1",
4041
"eslint-plugin-prettier": "^2.2.0",
4142
"eslint-plugin-react": "^7.3.0",
43+
"eslint-plugin-standard": "^3.0.1",
4244
"prettier": "^1.7.0",
4345
"rimraf": "^2.6.2"
4446
},

standard.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use strict";
2+
3+
module.exports = {
4+
rules: {
5+
"standard/array-bracket-even-spacing": "off",
6+
"standard/computed-property-even-spacing": "off",
7+
"standard/object-curly-even-spacing": "off"
8+
}
9+
};

test-lint/standard.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable quotes */
2+
"use strict";
3+
4+
// Prettier wants to break on new lines inside the square brackets, but
5+
// eslint-config-standard wants all on one line.
6+
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong[
7+
index
8+
];

yarn.lock

+4
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,10 @@ eslint-plugin-react@^7.3.0:
11431143
jsx-ast-utils "^2.0.0"
11441144
prop-types "^15.5.10"
11451145

1146+
eslint-plugin-standard@^3.0.1:
1147+
version "3.0.1"
1148+
resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2"
1149+
11461150
eslint-scope@^3.7.1:
11471151
version "3.7.1"
11481152
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"

0 commit comments

Comments
 (0)