Skip to content

Commit 4e00d62

Browse files
committed
reformat config as defined style
1 parent 5d81aff commit 4e00d62

File tree

6 files changed

+350
-169
lines changed

6 files changed

+350
-169
lines changed

es5.js

Lines changed: 145 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,152 @@
1+
'use strict';
2+
13
module.exports = {
2-
rules: {
3-
// Possible Errors
4-
// http://eslint.org/docs/rules/#possible-errors
5-
// ---------------------------------------------
6-
'no-cond-assign': 'error', // eslint:recommended
7-
'no-irregular-whitespace': 'error', // eslint:recommended
8-
'no-unexpected-multiline': 'error', // eslint:recommended
9-
'valid-jsdoc': ['error', {
10-
requireParamDescription: false,
11-
requireReturnDescription: false,
12-
requireReturn: false,
13-
prefer: {returns: 'return'}
14-
}],
15-
'no-console': 'error',
16-
'no-constant-condition': 'error',
17-
'no-control-regex': 'error',
18-
'no-debugger': 'error',
19-
'no-dupe-keys': 'error',
20-
'no-dupe-args': 'error',
21-
'no-duplicate-case': 'error',
22-
'no-empty': 'error',
23-
'no-empty-character-class': 'error',
24-
'no-ex-assign': 'error',
25-
'no-extra-boolean-cast': 'error',
26-
'no-extra-semi': 'error',
27-
'no-func-assign': 'error',
28-
'no-inner-declarations': ['error', "functions"],
29-
'no-invalid-regexp': 'error',
30-
'no-unsafe-negation': 'error',
31-
'no-obj-calls': 'error',
32-
'no-regex-spaces': 'error',
33-
'no-sparse-arrays': 'error',
34-
'no-unreachable': 'error',
35-
'use-isnan': 'error',
36-
'valid-typeof': 'error',
4+
rules: {
5+
// Possible Errors
6+
// http://eslint.org/docs/rules/#possible-errors
7+
// ---------------------------------------------
8+
'no-cond-assign': 'error', // eslint:recommended
9+
'no-irregular-whitespace': 'error', // eslint:recommended
10+
'no-unexpected-multiline': 'error', // eslint:recommended
11+
'valid-jsdoc': ['error', {
12+
requireParamDescription: false,
13+
requireReturnDescription: false,
14+
requireReturn: false,
15+
prefer: {returns: 'return'}
16+
}],
17+
'no-console': 'error',
18+
'no-constant-condition': 'error',
19+
'no-control-regex': 'error',
20+
'no-debugger': 'error',
21+
'no-dupe-keys': 'error',
22+
'no-dupe-args': 'error',
23+
'no-duplicate-case': 'error',
24+
'no-empty': 'error',
25+
'no-empty-character-class': 'error',
26+
'no-ex-assign': 'error',
27+
'no-extra-boolean-cast': 'error',
28+
'no-extra-semi': 'error',
29+
'no-func-assign': 'error',
30+
'no-inner-declarations': ['error', 'functions'],
31+
'no-invalid-regexp': 'error',
32+
'no-unsafe-negation': 'error',
33+
'no-obj-calls': 'error',
34+
'no-regex-spaces': 'error',
35+
'no-sparse-arrays': 'error',
36+
'no-unreachable': 'error',
37+
'use-isnan': 'error',
38+
'valid-typeof': 'error',
3739

38-
// Best Practices
39-
// http://eslint.org/docs/rules/#best-practices
40-
// --------------------------------------------
40+
// Best Practices
41+
// http://eslint.org/docs/rules/#best-practices
42+
// --------------------------------------------
4143

42-
'guard-for-in': 'error',
43-
'no-caller': 'error',
44-
'no-extend-native': 'error',
45-
'no-extra-bind': 'error',
46-
'no-invalid-this': 'error',
47-
'no-multi-spaces': 'error',
48-
'no-multi-str': 'error',
49-
'no-new-wrappers': 'error',
50-
'no-throw-literal': 'error', // eslint:recommended
51-
'no-with': 'error',
52-
'consistent-return': 'error',
53-
'curly': ['error', "all"],
54-
'eqeqeq': 'error',
55-
'no-alert': 'error',
56-
'no-eval': 'error',
57-
'no-fallthrough': 'error',
58-
'no-floating-decimal': 'error',
59-
'no-implied-eval': 'error',
60-
'no-iterator': 'error',
61-
'no-labels': 'error',
62-
'no-lone-blocks': 'error',
63-
'no-global-assign': 'error',
64-
'no-new': 'error',
65-
'no-new-func': 'error',
66-
'no-octal': 'error', //default
67-
'no-octal-escape': 'error',
68-
'no-proto': 'error',
69-
'no-redeclare': 'error', //default
70-
'no-return-assign': 'error',
71-
'no-script-url': 'error',
72-
'no-sequences': 'error',
73-
'no-unused-expressions': 'error',
74-
'radix': 'error',
44+
'guard-for-in': 'error',
45+
'no-caller': 'error',
46+
'no-extend-native': 'error',
47+
'no-extra-bind': 'error',
48+
'no-invalid-this': 'error',
49+
'no-multi-spaces': 'error',
50+
'no-multi-str': 'error',
51+
'no-new-wrappers': 'error',
52+
'no-throw-literal': 'error', // eslint:recommended
53+
'no-with': 'error',
54+
'consistent-return': 'error',
55+
'curly': ['error', 'all'],
56+
'eqeqeq': 'error',
57+
'no-alert': 'error',
58+
'no-eval': 'error',
59+
'no-fallthrough': 'error',
60+
'no-floating-decimal': 'error',
61+
'no-implied-eval': 'error',
62+
'no-iterator': 'error',
63+
'no-labels': 'error',
64+
'no-lone-blocks': 'error',
65+
'no-global-assign': 'error',
66+
'no-new': 'error',
67+
'no-new-func': 'error',
68+
'no-octal': 'error', // default
69+
'no-octal-escape': 'error',
70+
'no-proto': 'error',
71+
'no-redeclare': 'error', // default
72+
'no-return-assign': 'error',
73+
'no-script-url': 'error',
74+
'no-sequences': 'error',
75+
'no-unused-expressions': 'error',
76+
'radix': 'error',
7577

76-
// Strict Mode
77-
// http://eslint.org/docs/rules/#strict-mode
78-
// -----------------------------------------
79-
'strict': ['error', 'global'],
78+
// Strict Mode
79+
// http://eslint.org/docs/rules/#strict-mode
80+
// -----------------------------------------
81+
'strict': ['error', 'global'],
8082

81-
// Variables
82-
// http://eslint.org/docs/rules/#variables
83-
// ---------------------------------------
84-
'no-unused-vars': ['error', {args: 'none'}], // eslint:recommended
85-
'no-delete-var': 'error', //eslint:recommended
86-
'no-label-var': 'error',
87-
'no-shadow': 'error',
88-
'no-shadow-restricted-names': 'error',
89-
'no-undef': 'error', //default
90-
'no-undef-init': 'error',
91-
'no-undefined': 'error',
83+
// Variables
84+
// http://eslint.org/docs/rules/#variables
85+
// ---------------------------------------
86+
'no-unused-vars': ['error', {args: 'none'}], // eslint:recommended
87+
'no-delete-var': 'error', // eslint:recommended
88+
'no-label-var': 'error',
89+
'no-shadow': 'error',
90+
'no-shadow-restricted-names': 'error',
91+
'no-undef': 'error', // default
92+
'no-undef-init': 'error',
93+
'no-undefined': 'error',
9294

93-
// Node.js and CommonJS
94-
// http://eslint.org/docs/rules/#nodejs-and-commonjs
95-
// -------------------------------------------------
96-
'no-process-exit': 'error',
95+
// Node.js and CommonJS
96+
// http://eslint.org/docs/rules/#nodejs-and-commonjs
97+
// -------------------------------------------------
98+
'no-process-exit': 'error',
9799

98-
// Stylistic Issues
99-
// http://eslint.org/docs/rules/#stylistic-issues
100-
// ----------------------------------------------
101-
'indent': ['error', 2, {
102-
SwitchCase: 1,
103-
// continuation indent
104-
VariableDeclarator: 1, // indent is multiplier * indent = 1 * 2
105-
MemberExpression: 1, // indent is multiplier * indent = 1 * 2
106-
FunctionDeclaration: {parameters: 2},
107-
FunctionExpression: {parameters: 2},
108-
CallExpression: {arguments: 2}
109-
}],
110-
'block-spacing': ['error', 'always'],
111-
'array-bracket-spacing': ['error', 'never'],
112-
'brace-style': 'error',
113-
'camelcase': 'error',
114-
'comma-dangle': ['error', 'only-multiline'],
115-
'comma-spacing': 'error',
116-
'comma-style': 'error',
117-
'computed-property-spacing': 'error',
118-
'eol-last': 'error',
119-
'func-call-spacing': 'error',
120-
'key-spacing': 'error',
121-
'keyword-spacing': 'error',
122-
'linebreak-style': 'off', // check this in git
123-
'new-cap': 'error',
124-
'no-array-constructor': 'error',
125-
'no-mixed-spaces-and-tabs': 'error', // eslint:recommended
126-
'no-multiple-empty-lines': ['error', {max: 2}],
127-
'no-new-object': 'error',
128-
'no-trailing-spaces': 'error',
129-
'object-curly-spacing': 'error',
130-
'one-var': ['error', {
131-
var: 'never',
132-
let: 'never',
133-
const: 'never'
134-
}],
135-
'padded-blocks': ['off', 'never'],
136-
'quote-props': ['error', 'consistent'],
137-
'quotes': ['error', 'single', {allowTemplateLiterals: true}],
138-
'semi-spacing': 'error',
139-
'semi': 'error',
140-
'space-before-blocks': 'error',
141-
'space-before-function-paren': ['error', {named: 'never', anonymous: 'always'}],
142-
'spaced-comment': ['error', 'always'],
143-
'unicode-bom': 'warn',
144-
'new-parens': 'error',
145-
'no-nested-ternary': 'error',
146-
'space-infix-ops': 'error',
147-
'space-unary-ops': ['error', {words: true, nonwords: false}],
148-
'yoda': ['error', "never"]
149-
}
150-
};
100+
// Stylistic Issues
101+
// http://eslint.org/docs/rules/#stylistic-issues
102+
// ----------------------------------------------
103+
'indent': ['error', 2, {
104+
SwitchCase: 1,
105+
// continuation indent
106+
VariableDeclarator: 1, // indent is multiplier * indent = 1 * 2
107+
MemberExpression: 1, // indent is multiplier * indent = 1 * 2
108+
FunctionDeclaration: {parameters: 2},
109+
FunctionExpression: {parameters: 2},
110+
CallExpression: {arguments: 2}
111+
}],
112+
'block-spacing': ['error', 'always'],
113+
'array-bracket-spacing': ['error', 'never'],
114+
'brace-style': 'error',
115+
'camelcase': 'error',
116+
'comma-dangle': ['error', 'only-multiline'],
117+
'comma-spacing': 'error',
118+
'comma-style': 'error',
119+
'computed-property-spacing': 'error',
120+
'eol-last': 'error',
121+
'func-call-spacing': 'error',
122+
'key-spacing': 'error',
123+
'keyword-spacing': 'error',
124+
'linebreak-style': 'off', // check this in git
125+
'new-cap': 'error',
126+
'no-array-constructor': 'error',
127+
'no-mixed-spaces-and-tabs': 'error', // eslint:recommended
128+
'no-multiple-empty-lines': ['error', {max: 2}],
129+
'no-new-object': 'error',
130+
'no-trailing-spaces': 'error',
131+
'object-curly-spacing': 'error',
132+
'one-var': ['error', {
133+
var: 'never',
134+
let: 'never',
135+
const: 'never'
136+
}],
137+
'padded-blocks': ['off', 'never'],
138+
'quote-props': ['error', 'consistent'],
139+
'quotes': ['error', 'single', {allowTemplateLiterals: true}],
140+
'semi-spacing': 'error',
141+
'semi': 'error',
142+
'space-before-blocks': 'error',
143+
'space-before-function-paren': ['error', {named: 'never', anonymous: 'always'}],
144+
'spaced-comment': ['error', 'always'],
145+
'unicode-bom': 'warn',
146+
'new-parens': 'error',
147+
'no-nested-ternary': 'error',
148+
'space-infix-ops': 'error',
149+
'space-unary-ops': ['error', {words: true, nonwords: false}],
150+
'yoda': ['error', 'never']
151+
}
152+
};

es6.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
module.exports = {
2-
extends: ['htmlacademy/es5'],
3-
rules: {
4-
// ECMAScript 6
5-
// http://eslint.org/docs/rules/#ecmascript-6
6-
// ------------------------------------------
7-
'arrow-parens': ['error', 'always'],
8-
// parens are optional but recommended.
9-
// ESLint doesn't support a *consistent*
10-
// setting so "always" is used.
11-
'constructor-super': 'error', // eslint:recommended
12-
'generator-star-spacing': ['error', 'after'],
13-
'no-new-symbol': 'error', // eslint:recommended
14-
'no-this-before-super': 'error', // eslint:recommended
15-
'no-var': 'error',
16-
'prefer-rest-params': 'error',
17-
'prefer-spread': 'error',
18-
'rest-spread-spacing': 'error',
19-
'yield-star-spacing': ['error', 'after'],
2+
extends: [`htmlacademy/es5`],
3+
rules: {
4+
// ECMAScript 6
5+
// http://eslint.org/docs/rules/#ecmascript-6
6+
// ------------------------------------------
7+
'arrow-parens': [`error`, `always`],
8+
// parens are optional but recommended.
9+
// ESLint doesn't support a *consistent*
10+
// setting so "always" is used.
11+
'constructor-super': `error`, // eslint:recommended
12+
'generator-star-spacing': [`error`, `after`],
13+
'no-new-symbol': `error`, // eslint:recommended
14+
'no-this-before-super': `error`, // eslint:recommended
15+
'no-var': `error`,
16+
'prefer-rest-params': `error`,
17+
'prefer-spread': `error`,
18+
'rest-spread-spacing': `error`,
19+
'yield-star-spacing': [`error`, `after`],
2020

21-
'object-shorthand': ['error', 'always', { 'avoidQuotes': true }],
21+
'object-shorthand': [`error`, `always`, {'avoidQuotes': true}],
2222

23-
'quotes': ['error', 'backtick'] // https://github.com/htmlacademy/eslint-config-htmlacademy/issues/4
24-
}
25-
};
23+
'quotes': [`error`, `backtick`] // https://github.com/htmlacademy/eslint-config-htmlacademy/issues/4
24+
}
25+
};

test/es5/.eslintrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
let config = require('../../es5');
22
config.env = {
3-
'es6': false,
4-
'browser': true
3+
'es6': false,
4+
'browser': true,
5+
'commonjs': true
56
};
67

78
module.exports = config;

0 commit comments

Comments
 (0)