diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..6b94429 --- /dev/null +++ b/.github/workflows/linter.yml @@ -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 diff --git a/package.json b/package.json index 2432eba..c0cde74 100644 --- a/package.json +++ b/package.json @@ -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",