Skip to content

Commit

Permalink
add linter to CI (#41)
Browse files Browse the repository at this point in the history
- create continuous integration for linter
- move --fix out of the main `npm run lint` script. moved to `npm run lint:fix`. CI now runs `npm run lint`, and should not be changing any files, just checking
  • Loading branch information
NovemLinguae authored Jun 2, 2024
1 parent a91d0db commit 82bf233
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Linter

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run lint
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
"test:delay": "mocha --delay --require @babel/register --reporter list",
"lint:es5": "jshint \"dist/loader-dev.js\" \"dist/loader-gadget.js\"",
"lint:es5:dev": "jshint \"dist/loader-dev.js\"",
"lint:css": "stylelint \"styles-src/**/*.css\" --fix",
"lint:es6": "eslint \"xfdcloser-src/**/*.js\" \"test/*\" --fix",
"lint:bin": "eslint \"bin/*.js\" --fix --env node",
"lint:css": "stylelint \"styles-src/**/*.css\"",
"lint:es6": "eslint \"xfdcloser-src/**/*.js\" \"test/*\"",
"lint:bin": "eslint \"bin/*.js\" --env node",
"lint": "npm run lint:es6 && npm run lint:es5 && npm run lint:css",
"lint:dev": "npm run lint:es6 && npm run lint:es5:dev && npm run lint:css",
"lint:css:fix": "stylelint \"styles-src/**/*.css\" --fix",
"lint:es6:fix": "eslint \"xfdcloser-src/**/*.js\" \"test/*\" --fix",
"lint:bin:fix": "eslint \"bin/*.js\" --fix --env node",
"lint:fix": "npm run lint:es6:fix && npm run lint:bin:fix && npm run lint:css:fix",
"globals:node": "concat-cli -f \"globals-src/comment.js\" \"globals-src/node.js\" -o \"globals.js\"",
"globals:window": "concat-cli -f \"globals-src/comment.js\" \"globals-src/window.js\" -o \"globals.js\"",
"build:loader:dev": "concat-cli -f \"loader-src/loader-dev-top.js.txt\" \"loader-src/loader-core.js.txt\" \"loader-src/loader-dev-bottom.js.txt\" -o dist/loader-dev.js",
Expand Down

0 comments on commit 82bf233

Please sign in to comment.