Add eslint dependency within Node.js package (#3813)

This commit is contained in:
Manish Jethani 2021-08-13 16:13:20 +05:30 committed by GitHub
parent f98666f7a3
commit daff6b3a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -28,12 +28,10 @@ dist/build/uBlock0.nodejs: tools/make-nodejs.sh $(sources) $(platform) $(assets)
nodejs: dist/build/uBlock0.nodejs nodejs: dist/build/uBlock0.nodejs
lint: nodejs lint: nodejs
eslint -c platform/nodejs/eslintrc.json \ cd dist/build/uBlock0.nodejs && npm install && npm run lint
dist/build/uBlock0.nodejs/js \
dist/build/uBlock0.nodejs/*.js
test: nodejs test: nodejs
cd dist/build/uBlock0.nodejs && npm run test cd dist/build/uBlock0.nodejs && npm install && npm run test
# Update submodules. # Update submodules.
update-submodules: update-submodules:

View File

@ -6,6 +6,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "node build.js", "build": "node build.js",
"lint": "eslint js/ *.js",
"test": "node test.js" "test": "node test.js"
}, },
"repository": { "repository": {
@ -27,5 +28,8 @@
"engines": { "engines": {
"node": ">=14.0.0", "node": ">=14.0.0",
"npm": ">=6.14.4" "npm": ">=6.14.4"
},
"devDependencies": {
"eslint": "^7.32.0"
} }
} }

View File

@ -52,6 +52,7 @@ node -pe "JSON.stringify(fs.readFileSync('$THIRDPARTY/easylist.txt', 'utf8'))" \
node -pe "JSON.stringify(fs.readFileSync('$THIRDPARTY/easyprivacy.txt', 'utf8'))" \ node -pe "JSON.stringify(fs.readFileSync('$THIRDPARTY/easyprivacy.txt', 'utf8'))" \
> $DES/data/easyprivacy.json > $DES/data/easyprivacy.json
cp platform/nodejs/.*.json $DES/
cp platform/nodejs/*.js $DES/ cp platform/nodejs/*.js $DES/
cp platform/nodejs/*.json $DES/ cp platform/nodejs/*.json $DES/
cp platform/nodejs/README.md $DES/ cp platform/nodejs/README.md $DES/