Skip to content

Commit b522f26

Browse files
authored
feat: Rule updates for defaults (#4)
* feat: disable func-style enforcment * feat: set no-shadow to warn * feat: warn on arrow-callback check * feat: update no-use-before-define for func-style update * feat: Allow the use of For ( In / Of ) * feat: Add Jest to env object
1 parent 2e47460 commit b522f26

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

rules/es2015.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = {
105105

106106
// require arrow functions as callbacks
107107
// http://eslint.org/docs/rules/prefer-arrow-callback
108-
'prefer-arrow-callback': ['error', {
108+
'prefer-arrow-callback': ['warn', {
109109
allowNamedFunctions: false,
110110
allowUnboundThis: true,
111111
}],

rules/node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
env: {
33
node: true,
4+
jest: true,
45
mocha: true
56
},
67

rules/stylistic-issues.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module.exports = {
7777

7878
// enforce the consistent use of either function declarations or expressions
7979
// http://eslint.org/docs/rules/func-style
80-
'func-style': ['error', 'expression'],
80+
'func-style': 'off',
8181

8282
// disallow specified identifiers
8383
// http://eslint.org/docs/rules/id-blacklist
@@ -282,8 +282,6 @@ module.exports = {
282282
// http://eslint.org/docs/rules/no-restricted-syntax
283283
'no-restricted-syntax': [
284284
'error',
285-
'ForInStatement',
286-
'ForOfStatement',
287285
'LabeledStatement',
288286
'WithStatement',
289287
],

rules/variables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626

2727
// disallow variable declarations from shadowing variables declared in the outer scope
2828
// http://eslint.org/docs/rules/no-shadow
29-
'no-shadow': 'error',
29+
'no-shadow': 'warn',
3030

3131
// disallow initializing variables to undefined
3232
// http://eslint.org/docs/rules/no-undef-init
@@ -46,6 +46,6 @@ module.exports = {
4646

4747
// disallow the use of variables before they are defined
4848
// http://eslint.org/docs/rules/no-use-before-define
49-
'no-use-before-define': 'error'
49+
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
5050
}
5151
};

0 commit comments

Comments
 (0)