mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-23 19:47:04 -04:00
Update eslintrc.
This commit is contained in:
parent
a893cb7534
commit
73e74bb887
3 changed files with 5 additions and 4 deletions
|
@ -18,7 +18,7 @@
|
||||||
comma-dangle: [2, never]
|
comma-dangle: [2, never]
|
||||||
comma-spacing: [2, {before: false, after: true}]
|
comma-spacing: [2, {before: false, after: true}]
|
||||||
comma-style: [2, last]
|
comma-style: [2, last]
|
||||||
complexity: [1, 25] ###
|
complexity: [1, 10] ###
|
||||||
computed-property-spacing: [2, never]
|
computed-property-spacing: [2, never]
|
||||||
consistent-return: 2
|
consistent-return: 2
|
||||||
consistent-this: [2, self]
|
consistent-this: [2, self]
|
||||||
|
@ -41,8 +41,8 @@
|
||||||
max-depth: [1, 4]
|
max-depth: [1, 4]
|
||||||
max-len: [0, 80, 4]
|
max-len: [0, 80, 4]
|
||||||
max-nested-callbacks: [1, 3]
|
max-nested-callbacks: [1, 3]
|
||||||
max-params: [1, 5] ###
|
max-params: [1, 4] ###
|
||||||
max-statements: [1, 80] ###
|
max-statements: [1, 30] ###
|
||||||
new-cap: 0
|
new-cap: 0
|
||||||
new-parens: 2
|
new-parens: 2
|
||||||
newline-after-var: 0
|
newline-after-var: 0
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
---
|
---
|
||||||
rules:
|
rules:
|
||||||
max-params: [1, 10]
|
|
||||||
no-console: 1
|
no-console: 1
|
||||||
prefer-reflect: 0
|
prefer-reflect: 0
|
||||||
|
|
|
@ -10,6 +10,7 @@ const dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-
|
||||||
const reHex = /^0x[0-9a-f]+$/i;
|
const reHex = /^0x[0-9a-f]+$/i;
|
||||||
const reLeadingZero = /^0/;
|
const reLeadingZero = /^0/;
|
||||||
|
|
||||||
|
/* eslint-disable complexity */
|
||||||
const naturalCmp = (val1, val2) => {
|
const naturalCmp = (val1, val2) => {
|
||||||
// convert all to strings strip whitespace
|
// convert all to strings strip whitespace
|
||||||
const x = String(val1).replace(reStrip, '');
|
const x = String(val1).replace(reStrip, '');
|
||||||
|
@ -56,6 +57,7 @@ const naturalCmp = (val1, val2) => {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
naturalCmp
|
naturalCmp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue