-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: configure patches for linter #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [20.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - run: npm install | ||
| - run: npm test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import globals from "globals"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're using top-level ES module syntax ( |
||
| import pluginJs from "@eslint/js"; | ||
|
|
||
| export default [ | ||
| pluginJs.configs.recommended, | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.node, | ||
| ...globals.jest, | ||
|
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
const mapToReadonly = (g) => Object.fromEntries(Object.keys(g).map(k => [k, 'readonly']));
...
globals: {
...mapToReadonly(globals.node),
...mapToReadonly(globals.jest),
},Or verify your ESLint version accepts boolean globals in the flat config format. |
||
| }, | ||
| ecmaVersion: "latest", | ||
| sourceType: "module", | ||
| }, | ||
| rules: { | ||
| "no-unused-vars": "warn", | ||
| "no-console": "off", | ||
| "semi": ["error", "always"], | ||
| "quotes": ["error", "single"], | ||
| }, | ||
| }, | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow matrix only includes Node 20.x. Consider expanding this to include at least the current LTS (for example,
18.x) so your tests run against multiple supported Node versions and surface compatibility issues earlier. If you intentionally want to test only Node 20, add a short comment explaining that decision.