Skip to content

Commit e9a66e4

Browse files
committed
feat: change rules for the styleguide of team
1 parent 69578c7 commit e9a66e4

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

rules/best-practices.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
'curly': ['error', 'multi-line'],
2626

2727
// require default case in switch statements
28-
'default-case': 'off',
28+
'default-case': 'error',
2929

3030
// enforce newline before and after dot
3131
'dot-location': ['error', 'property'],
@@ -86,7 +86,7 @@ module.exports = {
8686
'no-fallthrough': 'error',
8787

8888
// disallow floating decimals
89-
'no-floating-decimal': 'error',
89+
'no-floating-decimal': 'off',
9090

9191
// disallow assignment to native objects or read-only global variables
9292
'no-global-assign': 'error',
@@ -125,7 +125,7 @@ module.exports = {
125125
'no-multi-str': 'error',
126126

127127
// disallow new for side effects
128-
'no-new': 'error',
128+
'no-new': 'off',
129129

130130
// disallow function constructor
131131
'no-new-func': 'error',
@@ -234,6 +234,6 @@ module.exports = {
234234
'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
235235

236236
// require or disallow Yoda conditions
237-
'yoda': ['error', 'never']
237+
'yoda': 'off'
238238
}
239239
}

rules/es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = {
8787
'prefer-rest-params': 'error',
8888

8989
// suggest using the spread operator instead of .apply()
90-
'prefer-spread': 'warn',
90+
'prefer-spread': 'off',
9191

9292
// suggest using template literals instead of string concatenation
9393
'prefer-template': 'error',

rules/style.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module.exports = {
1616
'block-spacing': 'error',
1717

1818
// require brace style
19-
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
19+
// 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
20+
'brace-style': 'off',
2021

2122
// require camelcase
2223
'camelcase': ['error', { properties: 'never' }],
@@ -151,7 +152,7 @@ module.exports = {
151152
'no-inline-comments': 'off',
152153

153154
// disallow if statements as the only statement in else blocks
154-
'no-lonely-if': 'error',
155+
'no-lonely-if': 'off',
155156

156157
// Disallow mixes of different operators
157158
'no-mixed-operators': ['error', {
@@ -178,7 +179,7 @@ module.exports = {
178179
'no-negated-condition': 'off',
179180

180181
// disallow nested ternary expressions
181-
'no-nested-ternary': 'error',
182+
'no-nested-ternary': 'warn',
182183

183184
// disallow Object constructors
184185
'no-new-object': 'error',
@@ -256,7 +257,8 @@ module.exports = {
256257
'require-jsdoc': 'off',
257258

258259
// require or disallow semicolons instead of ASI
259-
'semi': ['error', 'never'],
260+
// 'semi': ['error', 'never'],
261+
'semi': 'off',
260262

261263
// enforce spacing before and after semicolons
262264
'semi-spacing': ['error', { before: false, after: true }],

test/validate-base.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import index from '../'
2-
import legacy from '../legacy'
32
import test from 'ava'
43

54
test('test basic properties of eslint config - index.js', t => {
65
t.truthy(isArray(index.extends))
76
t.truthy(isObject(index.parserOptions))
87
})
98

10-
test('test basic properties of eslint config - legacy.js', t => {
11-
t.truthy(isArray(legacy.extends))
12-
t.truthy(isObject(legacy.env))
13-
})
14-
159
function isObject (obj) {
1610
return typeof obj === 'object' && obj !== null
1711
}

test/validate-config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => {
1414
// the repo file to test lint
1515
const repoFiles = [
1616
'index.js',
17-
'legacy.js',
1817
'test/*.js'
1918
]
2019

0 commit comments

Comments
 (0)