Skip to content

Conversation

bjohansebas
Copy link
Member

The linter is not the tests. I want to run the tests peacefully without worrying about the linter. I can worry about the linter later after finishing my changes.

"pretest": "[ \"$NODE_LTS_LATEST\" != \"\" ] && [ \"$MATRIX_NODE_VERSION\" != \"$NODE_LTS_LATEST\" ] && echo 'Skipping linting' || npm run lint",
"test": "npm run tests-only",
"tests-only": "tap",
"test": "tap",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm test should always run everything. you run npm run tests-only if you only want to run the tests.

Comment on lines +12 to +26
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm install --ignore-scripts --include=dev

- name: Run lint
run: npm run lint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe we already run the linter via pretest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, should the linter run after the tests using posttest? I've never agreed that the linter should run with the tests—it should be something separate and in a different job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally, everything should run with npm test.

The CI jobs should be configured so that the linter runs once, and the tests run on every supported node version (minor or major).

Thus, npm test runs everything, and CI workflows run more granular scripts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the linter should live under the test command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? That's how every project I've maintained or contributed to works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants