Skip to content

Commit 429339e

Browse files
committed
[eslint config] [*] fix quoting of rule properties.
Per airbnb#885.
1 parent 8e125fa commit 429339e

File tree

12 files changed

+129
-139
lines changed

12 files changed

+129
-139
lines changed

packages/eslint-config-airbnb-base/rules/.eslintrc.json

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

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
'rules': {
2+
rules: {
33
// enforces getter/setter pairs in objects
44
'accessor-pairs': 0,
55

@@ -11,26 +11,26 @@ module.exports = {
1111
'block-scoped-var': 2,
1212

1313
// specify the maximum cyclomatic complexity allowed in a program
14-
'complexity': [0, 11],
14+
complexity: [0, 11],
1515

1616
// require return statements to either always or never specify values
1717
'consistent-return': 2,
1818

1919
// specify curly brace conventions for all control statements
20-
'curly': [2, 'multi-line'],
20+
curly: [2, 'multi-line'],
2121

2222
// require default case in switch statements
23-
'default-case': [2, { 'commentPattern': '^no default$' }],
23+
'default-case': [2, { commentPattern: '^no default$' }],
2424

2525
// encourages use of dot notation whenever possible
26-
'dot-notation': [2, { 'allowKeywords': true }],
26+
'dot-notation': [2, { allowKeywords: true }],
2727

2828
// enforces consistent newlines before or after dots
2929
'dot-location': 0,
3030

3131
// require the use of === and !==
3232
// http://eslint.org/docs/rules/eqeqeq
33-
'eqeqeq': [2, 'allow-null'],
33+
eqeqeq: [2, 'allow-null'],
3434

3535
// make sure for-in loops have an if statement
3636
'guard-for-in': 2,
@@ -54,7 +54,7 @@ module.exports = {
5454
// disallow empty functions, except for standalone funcs/arrows
5555
// http://eslint.org/docs/rules/no-empty-function
5656
'no-empty-function': [2, {
57-
'allow': [
57+
allow: [
5858
'arrowFunctions',
5959
'functions',
6060
'methods',
@@ -104,7 +104,7 @@ module.exports = {
104104
'no-iterator': 2,
105105

106106
// disallow use of labels for anything other then loops and switches
107-
'no-labels': [2, { 'allowLoop': false, 'allowSwitch': false }],
107+
'no-labels': [2, { allowLoop: false, allowSwitch: false }],
108108

109109
// disallow unnecessary nested blocks
110110
'no-lone-blocks': 2,
@@ -115,10 +115,10 @@ module.exports = {
115115
// disallow magic numbers
116116
// http://eslint.org/docs/rules/no-magic-numbers
117117
'no-magic-numbers': [0, {
118-
'ignore': [],
119-
'ignoreArrayIndexes': true,
120-
'enforceConst': true,
121-
'detectObjects': false,
118+
ignore: [],
119+
ignoreArrayIndexes: true,
120+
enforceConst: true,
121+
detectObjects: false,
122122
}],
123123

124124
// disallow use of multiple spaces
@@ -149,7 +149,7 @@ module.exports = {
149149
// disallow reassignment of function parameters
150150
// disallow parameter object manipulation
151151
// rule: http://eslint.org/docs/rules/no-param-reassign.html
152-
'no-param-reassign': [2, { 'props': true }],
152+
'no-param-reassign': [2, { props: true }],
153153

154154
// disallow usage of __proto__ property
155155
'no-proto': 2,
@@ -202,13 +202,13 @@ module.exports = {
202202
'no-void': 0,
203203

204204
// disallow usage of configurable warning terms in comments: e.g. todo
205-
'no-warning-comments': [0, { 'terms': ['todo', 'fixme', 'xxx'], 'location': 'start' }],
205+
'no-warning-comments': [0, { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],
206206

207207
// disallow use of the with statement
208208
'no-with': 2,
209209

210210
// require use of the second argument for parseInt()
211-
'radix': 2,
211+
radix: 2,
212212

213213
// requires to declare all vars on top of their containing scope
214214
'vars-on-top': 2,
@@ -218,6 +218,6 @@ module.exports = {
218218
'wrap-iife': [2, 'outside'],
219219

220220
// require or disallow Yoda conditions
221-
'yoda': 2
221+
yoda: 2
222222
}
223223
};

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
'rules': {
2+
rules: {
33
// require trailing commas in multiline object literals
44
'comma-dangle': [2, 'always-multiline'],
55

@@ -42,9 +42,9 @@ module.exports = {
4242
// disallow unnecessary parentheses
4343
// http://eslint.org/docs/rules/no-extra-parens
4444
'no-extra-parens': [0, 'all', {
45-
'conditionalAssign': true,
46-
'nestedBinaryExpressions': false,
47-
'returnAssign': false,
45+
conditionalAssign: true,
46+
nestedBinaryExpressions: false,
47+
returnAssign: false,
4848
}],
4949

5050
// disallow unnecessary semicolons

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = {
2-
'env': {
3-
'es6': true
2+
env: {
3+
es6: true
44
},
5-
'parserOptions': {
6-
'ecmaVersion': 6,
7-
'sourceType': 'module',
8-
'ecmaFeatures': {
9-
'generators': false,
10-
'objectLiteralDuplicateProperties': false
5+
parserOptions: {
6+
ecmaVersion: 6,
7+
sourceType: 'module',
8+
ecmaFeatures: {
9+
generators: false,
10+
objectLiteralDuplicateProperties: false
1111
}
1212
},
1313

14-
'rules': {
14+
rules: {
1515
// enforces no braces where they can be omitted
1616
// http://eslint.org/docs/rules/arrow-body-style
1717
'arrow-body-style': [2, 'as-needed'],
@@ -21,14 +21,14 @@ module.exports = {
2121

2222
// require space before/after arrow function's arrow
2323
// http://eslint.org/docs/rules/arrow-spacing
24-
'arrow-spacing': [2, { 'before': true, 'after': true }],
24+
'arrow-spacing': [2, { before: true, after: true }],
2525

2626
// verify super() callings in constructors
2727
'constructor-super': 0,
2828

2929
// enforce the spacing around the * in generator functions
3030
// http://eslint.org/docs/rules/generator-star-spacing
31-
'generator-star-spacing': [2, { 'before': false, 'after': true }],
31+
'generator-star-spacing': [2, { before: false, after: true }],
3232

3333
// disallow modifying variables of class declarations
3434
// http://eslint.org/docs/rules/no-class-assign
@@ -37,7 +37,7 @@ module.exports = {
3737
// disallow arrow functions where they could be confused with comparisons
3838
// http://eslint.org/docs/rules/no-confusing-arrow
3939
'no-confusing-arrow': [2, {
40-
'allowParens': true,
40+
allowParens: true,
4141
}],
4242

4343
// disallow modifying variables that are declared using const
@@ -76,20 +76,20 @@ module.exports = {
7676
// require method and property shorthand syntax for object literals
7777
// http://eslint.org/docs/rules/object-shorthand
7878
'object-shorthand': [2, 'always', {
79-
'ignoreConstructors': false,
80-
'avoidQuotes': true,
79+
ignoreConstructors: false,
80+
avoidQuotes: true,
8181
}],
8282

8383
// suggest using arrow functions as callbacks
8484
'prefer-arrow-callback': [2, {
85-
'allowNamedFunctions': false,
86-
'allowUnboundThis': true,
85+
allowNamedFunctions: false,
86+
allowUnboundThis: true,
8787
}],
8888

8989
// suggest using of const declaration for variables that are never modified after declared
9090
'prefer-const': [2, {
91-
'destructuring': 'any',
92-
'ignoreReadBeforeAssign': true,
91+
destructuring: 'any',
92+
ignoreReadBeforeAssign: true,
9393
}],
9494

9595
// suggest using Reflect methods where applicable

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
module.exports = {
2-
'env': {
3-
'es6': true
2+
env: {
3+
es6: true
44
},
5-
'parserOptions': {
6-
'ecmaVersion': 6,
7-
'sourceType': 'module'
5+
parserOptions: {
6+
ecmaVersion: 6,
7+
sourceType: 'module'
88
},
9-
'plugins': [
9+
plugins: [
1010
'import'
1111
],
1212

13-
'settings': {
13+
settings: {
1414
'import/resolver': {
15-
'node': {
16-
'extensions': ['.js', '.json']
15+
node: {
16+
extensions: ['.js', '.json']
1717
}
1818
}
1919
},
2020

21-
'rules': {
21+
rules: {
2222
// Static analysis:
2323

2424
// ensure imports point to files/modules that can be resolved
2525
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
26-
'import/no-unresolved': [2, { 'commonjs': true }],
26+
'import/no-unresolved': [2, { commonjs: true }],
2727

2828
// ensure named imports coupled with named exports
2929
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
@@ -60,8 +60,8 @@ module.exports = {
6060
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
6161
// TODO: enable
6262
'import/no-extraneous-dependencies': [0, {
63-
'devDependencies': false,
64-
'optionalDependencies': false,
63+
devDependencies: false,
64+
optionalDependencies: false,
6565
}],
6666

6767
// Forbid mutable exports
@@ -106,7 +106,7 @@ module.exports = {
106106
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
107107
// TODO: enable?
108108
'import/order': [0, {
109-
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
109+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
110110
'newlines-between': 'never',
111111
}],
112112

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
2-
'env': {
3-
'node': true
2+
env: {
3+
node: true
44
},
55

6-
'rules': {
6+
rules: {
77
// enforce return after a callback
88
'callback-return': 0,
99

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
'rules': {
2+
rules: {
33
// babel inserts `'use strict';` for us
4-
'strict': [2, 'never']
4+
strict: [2, 'never']
55
}
66
};

0 commit comments

Comments
 (0)