-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eslint] fully enable
@ljharb
eslint config
- Loading branch information
Showing
90 changed files
with
611 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,124 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
}, | ||
"extends": "@ljharb", | ||
"globals": { | ||
"Promise": false, | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": "off", | ||
"complexity": "off", | ||
"eqeqeq": ["error", "always", { "null": "ignore" }], | ||
"func-style": "warn", | ||
"indent": ["error", 4], | ||
"key-spacing": "error", | ||
"quotes": ["error", "single", { | ||
"avoidEscape": true, | ||
}], | ||
"semi": ["error", "always"], | ||
"space-before-function-paren": ["error", { | ||
"anonymous": "always", | ||
"named": "never", | ||
}], | ||
"no-useless-escape": "error", | ||
"no-magic-numbers": "off", | ||
"max-lines": "warn", | ||
"max-lines-per-function": "warn", | ||
"max-statements": "warn", | ||
"max-statements-per-line": [2, { "max": 2 }], | ||
"multiline-comment-style": "off", | ||
"no-param-reassign": "warn", | ||
"no-negated-condition": "off", | ||
"no-use-before-define": "warn", | ||
"no-underscore-dangle": "warn", | ||
"operator-linebreak": ["error", "before"], | ||
"sort-keys": "warn", | ||
}, | ||
"ignorePatterns": [ "syntax-error.*" ], | ||
"overrides": [ | ||
{ | ||
"files": ["*.mjs", "test/import/package_type/*.js"], | ||
"extends": "@ljharb/eslint-config/esm", | ||
}, | ||
{ | ||
"files": ["bin/**"], | ||
"rules": { | ||
"global-require": "off", | ||
"no-process-exit": "off", | ||
"quote-props": ["error", "as-needed", { | ||
"keywords": false, | ||
}], | ||
}, | ||
}, | ||
{ | ||
"files": ["bin/import-or-require.js"], | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
}, | ||
}, | ||
{ | ||
"files": ["index.js"], | ||
"rules": { | ||
"no-param-reassign": "warn", | ||
}, | ||
}, | ||
{ | ||
"files": ["lib/results.js"], | ||
"rules": { | ||
"no-cond-assign": "warn", | ||
"no-param-reassign": "warn", | ||
"no-plusplus": "warn", | ||
}, | ||
}, | ||
{ | ||
"files": ["lib/test.js"], | ||
"rules": { | ||
"eqeqeq": "warn", | ||
"func-name-matching": "off", | ||
"max-params": "off", | ||
"no-continue": "off", | ||
"no-invalid-this": "off", | ||
"no-param-reassign": "warn", | ||
"no-plusplus": "warn", | ||
"no-multi-assign": "off", | ||
"no-restricted-syntax": "off", | ||
}, | ||
}, | ||
{ | ||
"files": ["test/async-await/*"], | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
}, | ||
}, | ||
{ | ||
"files": ["example/**", "test/**"], | ||
"globals": { | ||
"g": false, | ||
}, | ||
"rules": { | ||
"no-new-func": "off", | ||
}, | ||
}, | ||
{ | ||
"files": ["example/**"], | ||
"rules": { | ||
"array-bracket-newline": "off", | ||
"global-require": "off", | ||
"no-console": "off", | ||
}, | ||
}, | ||
{ | ||
"files": ["test/**"], | ||
"rules": { | ||
"dot-notation": [2, { | ||
"allowKeywords": true, | ||
"allowPattern": "throws" | ||
}], | ||
"id-length": "off", | ||
"max-len": "off", | ||
"max-lines-per-function": "off", | ||
"no-plusplus": "off", | ||
"no-throw-literal": "off", | ||
}, | ||
}, | ||
{ | ||
"files": ["test/*/**"], | ||
"rules": { | ||
"camelcase": "off", | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict'; | ||
|
||
var test = require('../../'); | ||
var path = require('path'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict'; | ||
|
||
var test = require('../../'); | ||
var path = require('path'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict'; | ||
|
||
var test = require('../../../'); | ||
test(function (t) { | ||
t.plan(1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
'use strict'; | ||
|
||
var test = require('../'); | ||
|
||
test('timing test', function (t) { | ||
t.plan(2); | ||
|
||
t.equal(typeof Date.now, 'function'); | ||
var start = new Date; | ||
var start = new Date(); | ||
|
||
setTimeout(function () { | ||
t.equal(new Date - start, 100); | ||
t.equal(new Date() - start, 100); | ||
}, 100); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.