Skip to content

Commit

Permalink
Set up lint-codebase CI step (ivov#126)
Browse files Browse the repository at this point in the history
* Set up `lint-codebase` CI step

* Fix main checks

* Adjust for local rules

* Add self-install command

* Test `exit 0` fix

* Revert "Test `exit 0` fix"

This reverts commit 9c438b2.

* Refactor `getFilenames`

* Fix missing `await`

* Stop on `2` error code only

* Fix relative path

* Format `make-lint-codebase-config.mjs`

* Force linter to crash to verify that CI check fails

* Revert "Force linter to crash to verify that CI check fails"

This reverts commit ba8cada.

* Move `lint-codebase` command to `publish-to-npm` workflow

* Format YAML files
  • Loading branch information
ivov authored Sep 13, 2022
1 parent 6434272 commit 51e6795
Show file tree
Hide file tree
Showing 9 changed files with 723 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Run checks
run: |
npm install
npm run lint
npm run lint-plugin
npm test
npm run build
env:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out commit
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -22,6 +22,7 @@ jobs:
run: |
npm ci
npm run build
npm run lint-codebase
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dist
node_modules
.DS_Store
.todo
.todo
scripts/downloads/*
.eslintplugin.js
15 changes: 15 additions & 0 deletions lint-codebase-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Config for the `lint-codebase` command.
*
* @type {import('@types/eslint').ESLint.ConfigData}
*/
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["eslint-plugin-local"],
extends: ["plugin:eslint-plugin-local/nodes", "plugin:eslint-plugin-local/credentials"],
};
Loading

0 comments on commit 51e6795

Please sign in to comment.