Skip to content

Commit

Permalink
Merge pull request #17 from ljharb/eslint
Browse files Browse the repository at this point in the history
switch to github actions; test on a matrix; run eslint in CI
  • Loading branch information
mattcg committed Aug 14, 2023
2 parents e5fd424 + 569db20 commit d69f938
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 31 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Tests: pretest'

on: [pull_request, push]

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
pretest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run pretest

18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Tests: node.js'

on: [pull_request, push]

jobs:
tests:
uses: ljharb/actions/.github/workflows/node-majors.yml@main
with:
range: '>= 12'
command: npm run tests-only && npm run coverage

node:
name: 'node tests'
needs: [tests]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'

10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions lib/Subtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true, esversion: 6*/

'use strict';

var index = require('language-subtag-registry/data/json/index.json');
Expand Down
2 changes: 0 additions & 2 deletions lib/Tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true, esversion: 6*/

'use strict';

var index = require('language-subtag-registry/data/json/index.json');
Expand Down
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true, esversion: 6*/

'use strict';

var Tag = require('./Tag.js');
Expand Down
25 changes: 19 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
},
"license": "MIT",
"scripts": {
"test": "nyc mocha ./test/",
"lint": "eslint --ext=js,mjs .",
"tests-only": "nyc mocha ./test/",
"pretest": "npm run lint",
"test": "npm run tests-only",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
"keywords": [
Expand All @@ -33,8 +36,9 @@
},
"devDependencies": {
"coveralls": "^3.1.1",
"nyc": "^15.1.0",
"mocha": "^10.2.0"
"eslint": "^8.47.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0"
},
"files": [
"/lib"
Expand All @@ -44,11 +48,20 @@
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
"ecmaVersion": 2022,
"sourceType": "script"
},
"env": {
"node": true
}
},
"overrides": [
{
"files": "test/**",
"globals": {
"suite": false,
"test": false
}
}
]
}
}
3 changes: 0 additions & 3 deletions test/lib/SubtagTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true*/
/*global test, suite*/

'use strict';

var assert = require('assert');
Expand Down
3 changes: 0 additions & 3 deletions test/lib/TagTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true*/
/*global test, suite*/

'use strict';

var assert = require('assert');
Expand Down
3 changes: 0 additions & 3 deletions test/lib/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* @copyright Copyright (c) 2013, Matthew Caruana Galizia
*/

/*jshint node:true*/
/*global test, suite*/

'use strict';

var assert = require('assert');
Expand Down

0 comments on commit d69f938

Please sign in to comment.