forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eslint rules based on recommend and standard rules, a few relaxtions …
…on code checking (warnings only)
- Loading branch information
Showing
2 changed files
with
70 additions
and
88 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,99 +1,82 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true, | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true, | ||
}, | ||
"globals": { | ||
// Allowed globals | ||
"console": true, | ||
"MediaSource": true, | ||
"performance": true, | ||
"crypto": true, | ||
"fetch": true, | ||
"Request": true, | ||
"Headers": true, | ||
"escape": true, | ||
// Compile-time defines | ||
"__VERSION__": true, | ||
"__USE_SUBTITLES__": true, | ||
"__USE_ALT_AUDIO__": true, | ||
"__USE_EME_DRM__": true | ||
// Allowed globals | ||
"console": true, | ||
//"MediaSource": true, | ||
"performance": true, | ||
"crypto": true, | ||
"fetch": true, | ||
"Request": true, | ||
"Headers": true, | ||
"escape": true, | ||
|
||
// Compile-time defines | ||
"__VERSION__": true, | ||
"__USE_SUBTITLES__": true, | ||
"__USE_ALT_AUDIO__": true, | ||
"__USE_EME_DRM__": true | ||
}, | ||
/* | ||
"extends": "node-style-guide", | ||
*/ | ||
// see https://standardjs.com/ | ||
// see https://github.com/standard/eslint-config-standard | ||
// see https://github.com/felixge/node-style-guide | ||
"extends": [ | ||
"eslint:recommended", | ||
"standard" | ||
], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["prettier"], | ||
"rules": { | ||
// our basic style rules | ||
"semi": ["error", "always"], | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"space-infix-ops": 2, | ||
"space-unary-ops": [2, {"words": true, "nonwords": false}], | ||
"space-in-parens": ["error", "never"], | ||
"keyword-spacing": [2, {"before": true, "after": true}], | ||
|
||
"one-var": 0, | ||
|
||
"no-bitwise": 0, | ||
"camelcase": 2, | ||
"curly": 2, | ||
"eqeqeq": 2, | ||
"no-eq-null": 2, | ||
"wrap-iife": [ | ||
2, | ||
"any" | ||
], | ||
"indent": [ | ||
2, | ||
2, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"no-use-before-define": [ | ||
2, | ||
{ | ||
"functions": false | ||
} | ||
], | ||
"new-cap": 2, | ||
"no-caller": 2, | ||
"quotes": [ | ||
2, | ||
"single" | ||
], | ||
"strict": 0, | ||
"no-undef": 2, | ||
"no-unused-vars": 2 | ||
// limit code block and line length | ||
/* | ||
"max-len": 0, | ||
"max-statements": 0, | ||
"max-depth": 0, | ||
"max-nested-callbacks": 0, | ||
"max-params": 0, | ||
"max-statements": 0, | ||
"max-statements-per-line": 0 | ||
*/ | ||
|
||
/* | ||
// customizations of Node style-guide | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"no-var": "error", | ||
"block-spacing": "error", | ||
"comma-style": ["error", "last"], | ||
"comma-spacing": ["error", { "before": false, "after": true }], | ||
"curly": ["error", "multi-or-nest", "consistent"], | ||
"object-curly-spacing": ["error", "always"], | ||
"object-curly-newline": ["error", { | ||
"ObjectExpression": "always", | ||
"ObjectPattern": { "multiline": false } | ||
}], | ||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "align": "colon" }], | ||
"semi": ["error", "always"], | ||
"object-property-newline": ["error"], | ||
// part of Node Style-guide but ignored | ||
"max-len": 0, | ||
"max-statements": 0, | ||
"space-after-keywords": 0 | ||
*/ | ||
// loosening of code-quality rules we may want to fix later | ||
// (warnings for now) | ||
"standard/no-callback-literal": 1, | ||
"import/first": 1, | ||
"no-empty": 1, | ||
"no-mixed-operators": 1, | ||
"no-unused-vars": 1, | ||
"no-console": 1, | ||
"no-fallthrough": 1, | ||
"no-case-declarations": 1, | ||
"no-irregular-whitespace": 1, | ||
"no-self-assign": 1, | ||
"new-cap": 1, | ||
"no-undefined": 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