Skip to content

Commit fb0f03f

Browse files
committed
[eslint config] [base] [deps] update eslint, eslint-plugin-import
- add temp disabled `func-call-spacing` rule - add temp disabled `no-template-curly-in-string` rule - enable `no-global-assign` and deprecate `no-native-reassign` - enable `no-unsafe-negation` and deprecate `no-negated-in-lhs` - add disabled `sort-keys` rule
1 parent 0b8e466 commit fb0f03f

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

packages/eslint-config-airbnb-base/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@
4747
"devDependencies": {
4848
"babel-preset-airbnb": "^2.0.0",
4949
"babel-tape-runner": "^2.0.1",
50-
"eslint": "^3.2.2",
50+
"eslint": "^3.3.0",
5151
"eslint-find-rules": "^1.13.0",
52-
"eslint-plugin-import": "^1.12.0",
52+
"eslint-plugin-import": "^1.13.0",
5353
"in-publish": "^2.0.0",
5454
"safe-publish-latest": "^1.0.1",
5555
"tape": "^4.6.0"
5656
},
5757
"peerDependencies": {
58-
"eslint": "^3.2.2",
59-
"eslint-plugin-import": "^1.12.0"
58+
"eslint": "^3.3.0",
59+
"eslint-plugin-import": "^1.13.0"
6060
},
6161
"engines": {
6262
"node": ">= 4"

packages/eslint-config-airbnb-base/rules/best-practices.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ module.exports = {
8989
// disallow the use of leading or trailing decimal points in numeric literals
9090
'no-floating-decimal': 2,
9191

92+
// disallow reassignments of native objects or read-only globals
93+
// http://eslint.org/docs/rules/no-global-assign
94+
'no-global-assign': [2, { exceptions: [] }],
95+
9296
// disallow implicit type conversions
9397
// http://eslint.org/docs/rules/no-implicit-coercion
9498
'no-implicit-coercion': [0, {
@@ -136,7 +140,8 @@ module.exports = {
136140
'no-multi-str': 2,
137141

138142
// disallow reassignments of native objects
139-
'no-native-reassign': 2,
143+
// TODO: deprecated in favor of no-global-assign
144+
'no-native-reassign': 0,
140145

141146
// disallow use of new operator when not part of the assignment or comparison
142147
'no-new': 2,

packages/eslint-config-airbnb-base/rules/errors.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ module.exports = {
6464
'no-irregular-whitespace': 2,
6565

6666
// disallow negation of the left operand of an in expression
67-
'no-negated-in-lhs': 2,
67+
// TODO: deprecated in favor of no-unsafe-negation
68+
'no-negated-in-lhs': 0,
6869

6970
// disallow the use of object properties of the global object (Math and JSON) as functions
7071
'no-obj-calls': 2,
@@ -79,6 +80,11 @@ module.exports = {
7980
// disallow sparse arrays
8081
'no-sparse-arrays': 2,
8182

83+
// Disallow template literal placeholder syntax in regular strings
84+
// http://eslint.org/docs/rules/no-template-curly-in-string
85+
// TODO: enable, semver-major
86+
'no-template-curly-in-string': 0,
87+
8288
// Avoid code that looks like two expressions but is actually one
8389
// http://eslint.org/docs/rules/no-unexpected-multiline
8490
'no-unexpected-multiline': 2,
@@ -90,6 +96,10 @@ module.exports = {
9096
// http://eslint.org/docs/rules/no-unsafe-finally
9197
'no-unsafe-finally': 2,
9298

99+
// disallow negating the left operand of relational operators
100+
// http://eslint.org/docs/rules/no-unsafe-negation
101+
'no-unsafe-negation': 2,
102+
93103
// disallow comparisons with the value NaN
94104
'use-isnan': 2,
95105

packages/eslint-config-airbnb-base/rules/style.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module.exports = {
2828
// enforce newline at the end of file, with no multiple empty lines
2929
'eol-last': 2,
3030

31+
// enforce spacing between functions and their invocations
32+
// http://eslint.org/docs/rules/func-call-spacing
33+
// TODO: enable, semver-minor
34+
'func-call-spacing': [0, 'never'],
35+
3136
// require function expressions to have a name
3237
'func-names': 1,
3338

@@ -264,6 +269,9 @@ module.exports = {
264269
// enforce spacing before and after semicolons
265270
'semi-spacing': [2, { before: false, after: true }],
266271

272+
// requires object keys to be sorted
273+
'sort-keys': [0, 'asc', { caseSensitive: false, natural: true }],
274+
267275
// sort variables within the same declaration block
268276
'sort-vars': 0,
269277

0 commit comments

Comments
 (0)