Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit b1dc9f7

Browse files
Backport for ESLint 1.10
1 parent 8ee64dd commit b1dc9f7

File tree

4 files changed

+25
-30
lines changed

4 files changed

+25
-30
lines changed

coding-styles/base.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,6 @@ module.exports = {
153153
mode: 'strict'
154154
}],
155155

156-
// This rule will enforce consistency of spacing around keywords and keyword-like tokens
157-
'keyword-spacing': [1, {
158-
before: true,
159-
after: true
160-
}],
161-
162156
// Disallow mixing CRLF and LF linebreaks
163157
// This rule aims to ensure having consistent line endings independent of operating system.
164158
'linebreak-style': [2, 'unix'],
@@ -285,13 +279,25 @@ module.exports = {
285279
// This rule is aimed at ensuring consistent use of semicolons.
286280
'semi': [1, 'never'],
287281

282+
// Require or disallow spaces following keywords
283+
// This rule will enforce consistency of spacing after the keywords `if`, `else`, `for`, `while`,
284+
// `do`, `switch`, `try`, `catch`, `finally`, and `with`.
285+
'space-after-keywords': [1, 'always'],
286+
288287
// Require Or Disallow Space Before Blocks
289288
// This rule will enforce consistency of spacing before blocks.
290289
'space-before-blocks': [1, 'always'],
291290

292291
// Require or disallow a space before function parenthesis
293292
'space-before-function-paren': [1, 'never'],
294293

294+
// Require or disallow spaces before keywords
295+
// This rule will enforce consistency of spacing before the keywords `if`, `else`, `for`, `while`,
296+
// `do`, `switch`, `throw`, `try`, `catch`, `finally`, `with`, `break`, `continue`, `return`,
297+
// `function`, `yield`, `class` and variable declarations (`let`, `const`, `var`) and label
298+
// statements.
299+
'space-before-keywords': [1, 'always'],
300+
295301
// Disallow or enforce spaces inside of parentheses
296302
// This rule will enforce consistency of spacing directly inside of parentheses, by disallowing or
297303
// requiring one or more spaces to the right of ( and to the left of ). In either case, () will

environments/nodejs/latest.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,16 @@ module.exports = {
1717
es6: true
1818
},
1919

20-
parserOptions: {
21-
ecmaVersion: 6
22-
},
23-
24-
rules: {
25-
// ESLint no longer supports disabling some still unsuported ES 2015 features, so we need to use
26-
// this rule to disable that syntax
27-
'no-restricted-syntax': [
28-
2,
29-
// Rest parameters (not to be confused with rest arguments)
30-
'RestElement',
31-
// Default function parameters
32-
'AssignmentPattern',
33-
// Destructuring assignment
34-
'ObjectPattern',
35-
// Experimental object/rest spread
36-
'ExperimentalRestProperty'
37-
]
20+
ecmaFeatures: {
21+
// Front-end specific
22+
jsx: false,
23+
// These are not implemented / behind flag - enable with caution (or use a transpiler)
24+
defaultParams: false,
25+
destructuring: false,
26+
modules: false,
27+
regexUFlag: false,
28+
regexYFlag: false,
29+
restParams: false,
30+
experimentalObjectRestSpread: false
3831
}
3932
}

environments/nodejs/legacy.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ module.exports = {
1515

1616
env: {
1717
node: true
18-
},
19-
20-
parserOptions: {
21-
ecmaVersion: 5
2218
}
2319
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"eslintconfig"
1616
],
1717
"license": "BSD-3-Clause",
18-
"main": "environments/nodejs/known-errors",
18+
"main": "environments/nodejs/latest",
1919
"peerDependencies": {
20-
"eslint": "^2.0.0-beta.2"
20+
"eslint": "^1.10.0"
2121
},
2222
"repository": {
2323
"type": "git",

0 commit comments

Comments
 (0)