forked from ivov/eslint-plugin-n8n-nodes-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
lint-codebase
command (ivov#151)
- Loading branch information
Showing
10 changed files
with
76 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: On push | ||
|
||
on: push | ||
|
||
jobs: | ||
run-checks: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "npm" | ||
|
||
- name: Run plugin checks | ||
run: | | ||
npm ci | ||
npm run lint-plugin | ||
npm test | ||
npm run typecheck | ||
env: | ||
CI: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
.DS_Store | ||
.todo | ||
scripts/downloads/* | ||
.eslintplugin.js | ||
.eslintplugin.js | ||
lint-run.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: "node", | ||
transform: { "^.+\\.ts$": "esbuild-jest" }, | ||
testPathIgnorePatterns: ["/dist/", "/node_modules/"], | ||
testPathIgnorePatterns: ["/dist/", "/node_modules/", "/scripts/downloads"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
#!/bin/bash | ||
|
||
echo 'Linting codebase...' | ||
echo 'Step 1: Setting up linter...' | ||
|
||
./node_modules/eslint/bin/eslint.js --no-eslintrc --config lint-codebase-config.js --ext .ts scripts/downloads | ||
npm ci | ||
npm run build | ||
node scripts/make-lint-codebase-config.mjs | ||
|
||
# `make-lint-codebase-config.mjs` creates `.eslintplugin.js`, based on | ||
# `dist/index.js` (same as `index.js`) but with the rules dir path adjusted | ||
# relative to the root. `.eslintplugin.js` contains all the linter's rules | ||
# and is referenced implicitly by `lint-codebase-config.js`` | ||
|
||
echo 'Step 2: Fetching codebase...' | ||
|
||
node scripts/get-codebase.mjs | ||
|
||
echo 'Step 3: Linting codebase...' | ||
|
||
./node_modules/eslint/bin/eslint.js \ | ||
--no-eslintrc \ | ||
--config lint-codebase-config.js \ | ||
--ext .ts \ | ||
scripts/downloads \ | ||
> lint-run.log | ||
|
||
if [[ $? == 2 ]] ; then | ||
echo "Linter crashed while linting codebase" | ||
echo 'Linter crashed while running through codebase' | ||
exit 1 | ||
fi | ||
|
||
echo 'Linter successfully ran through codebase' | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters