1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 10:22:51 +01:00

Run ESLint during Node.js package generation (#3798)

This commit is contained in:
Manish Jethani 2021-08-03 02:25:03 +05:30 committed by GitHub
parent 502e5b0ec8
commit ad69c760fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 4 deletions

View File

@ -0,0 +1,18 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"indent": [ "warn", 4 ],
"getter-return": "off",
"no-control-regex": "off",
"no-empty": [ "error", { "allowEmptyCatch": true } ],
"no-useless-escape": "off"
}
}

View File

@ -19,6 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
/* eslint-disable-next-line no-redeclare */
/* globals process */
'use strict';

View File

@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals WebAssembly */
/* globals WebAssembly vAPI */
'use strict';
@ -223,7 +223,7 @@ const BidiTrieContainer = class {
}
if ( al === aR ) { return 0; }
}
return 0;
return 0; // eslint-disable-line no-unreachable
}
matchesLeft(icell, ar, r) {
@ -267,7 +267,7 @@ const BidiTrieContainer = class {
if ( icell === 0 ) { return 0; }
}
}
return 0;
return 0; // eslint-disable-line no-unreachable
}
matchesExtra(l, r, ix) {
@ -513,6 +513,7 @@ const BidiTrieContainer = class {
}
// TODO: we should never reach here because there will
// always be a boundary cell.
// eslint-disable-next-line no-debugger
debugger; // jshint ignore:line
// boundary cell + needle remainder
inext = this.addCell(0, 0, 0);

View File

@ -19,6 +19,8 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals self */
'use strict';
/******************************************************************************/

View File

@ -19,7 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals WebAssembly */
/* globals WebAssembly vAPI */
'use strict';

View File

@ -19,6 +19,8 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals document */
'use strict';
/******************************************************************************/

View File

@ -19,6 +19,8 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals vAPI */
'use strict';
/******************************************************************************/

View File

@ -54,6 +54,8 @@ cp platform/nodejs/*.js $DES/
cp platform/nodejs/*.json $DES/
cp LICENSE.txt $DES/
eslint -c platform/nodejs/eslintrc.json $DES/js $DES/*.js
if [ "$1" = all ]; then
echo "*** uBlock0.nodejs: Creating plain package..."
pushd $(dirname $DES/) > /dev/null