Skip to content

Commit

Permalink
feat: Add lint to the workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
evgnomon committed Oct 18, 2023
1 parent 783fe60 commit bc5c5eb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npm run build
- run: npm run fmt:check
- run: npm run lint
- run: npm run test
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ jobs:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
- run: npm ci
- run: npm run build
- run: npm run fmt:check
- run: npm run lint
- run: npm run test
- run: npm run build
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"scripts": {
"build": "tsc --rootDir src --declaration",
"lint": "eslint '{src,test}/**/*.{ts,js,jsx,tsx}'",
"test": "mocha",
"test": "mocha --require ts-node/register",
"test:watch": "npm run test -- --watch --watch-files src,test",
"fmt:base": "prettier 'src/**/*.{ts,js,jsx,tsx}'",
"fmt:base": "prettier '{src,test}/**/*.{ts,js,jsx,tsx}'",
"fmt": "npm run fmt:base -- --write",
"fmt:check": "npm run fmt:base -- --check"
},
Expand All @@ -25,6 +25,7 @@
"dotenv": "^16.3.1",
"eslint": "^8.51.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-mocha": "^10.2.0",
"mocha": "^10.2.0",
"prettier": "^2.8.8",
Expand Down
10 changes: 5 additions & 5 deletions test/sample.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const {assert} = require('chai');
import { assert } from "chai";

describe('another case', function () {
const expected = {hello: 'world'};
describe("another case", function () {
const expected = { hello: "world" };
let actual;
before(function () {
actual = {hello: 'world'};
actual = { hello: "world" };
});
it('returns desired response', function () {
it("returns desired response", function () {
assert.deepStrictEqual(actual, expected);
});
});

0 comments on commit bc5c5eb

Please sign in to comment.