diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58f00577..ca3c4465 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,29 @@ on: env: FORCE_COLOR: 2 + NODE_LINT: 14 # The Node.js version to run lint jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_LINT }} + cache: npm + + - name: Install npm dependencies + run: npm ci + + - name: Lint + run: npm run lint + test: name: Node ${{ matrix.node }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index b01cc2cc..e81c1ec0 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,14 @@ "node": ">=12" }, "scripts": { - "test": "mocha test" + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "fix": "npm run eslint -- --fix", + "mocha": "mocha", + "test": "mocha" }, "repository": { "type": "git", - "url": "git://github.com/dlmanning/gulp-sass" + "url": "git+https://github.com/dlmanning/gulp-sass.git" }, "keywords": [ "gulpplugin", @@ -23,6 +26,7 @@ "bugs": { "url": "https://github.com/dlmanning/gulp-sass/issues" }, + "homepage": "https://github.com/dlmanning/gulp-sass#readme", "files": [ "index.js" ], diff --git a/test/lint.js b/test/lint.js deleted file mode 100644 index 071b8fc4..00000000 --- a/test/lint.js +++ /dev/null @@ -1,46 +0,0 @@ -const eslint = require('eslint'); -const should = require('should'); - -describe('code style guide', () => { - it('index.js should follow our lint style guide', (done) => { - const cli = new eslint.CLIEngine({ rules: { 'spaced-comment': 0 } }); - const formatter = cli.getFormatter(); - const report = cli.executeOnFiles(['index.js']); - - if (report.errorCount > 0 || report.warningCount > 0) { - console.log(formatter(report.results)); - } - - should(report.errorCount).equal(0); - should(report.warningCount).equal(0); - done(); - }); - - it('test/main.js should follow our lint style guide', (done) => { - const cli = new eslint.CLIEngine(); - const formatter = cli.getFormatter(); - const report = cli.executeOnFiles(['test/main.js']); - - if (report.errorCount > 0 || report.warningCount > 0) { - console.log(formatter(report.results)); - } - - should(report.errorCount).equal(0); - should(report.warningCount).equal(0); - done(); - }); - - it('test/lint.js should follow our lint style guide', (done) => { - const cli = new eslint.CLIEngine({ rules: { 'no-console': 0 } }); - const formatter = cli.getFormatter(); - const report = cli.executeOnFiles(['test/lint.js']); - - if (report.errorCount > 0 || report.warningCount > 0) { - console.log(formatter(report.results)); - } - - should(report.errorCount).equal(0); - should(report.warningCount).equal(0); - done(); - }); -});