Skip to content

Commit

Permalink
chore: lint mjs files and ignore json files (#6352)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**

`.mjs` files (`eslint.config.mjs`) aren't linted and in my IDE it keeps
breaking the JSON files.

**How did you fix it?**

Lint `.mjs` files and ignore JSON files.

**Checklist**
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [x] I have set the packages that need to be released for my changes to
be effective.
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
  • Loading branch information
merceyz committed Jun 24, 2024
1 parent a9cfe23 commit 57ed709
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import eslintConfig from '@yarnpkg/eslint-config';
import reactEslintConfig from '@yarnpkg/eslint-config/react';
import eslintConfig from '@yarnpkg/eslint-config';

// eslint-disable-next-line arca/no-default-export
export default [
...eslintConfig,
...reactEslintConfig,

{
ignores: [
`*.json`,
`**/coverage/**`,
`.yarn`,

`packages/docusaurus/.docusaurus`,
Expand All @@ -32,7 +35,7 @@ export default [

// Minimize the diff with upstream`,
`packages/yarnpkg-pnp/sources/node`,
`packages/yarnpkg-pnp/sources/loader/node-options*`
`packages/yarnpkg-pnp/sources/loader/node-options*`,
],
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"build:plugin-workspace-tools": "yarn node -r ./scripts/setup-ts-execution ./scripts/create-mock-plugin.ts workspace-tools",
"build:plugin-commands": "node ./scripts/gen-plugin-commands.js > packages/yarnpkg-cli/sources/pluginCommands.ts",
"build:compile": "rm -rf \"$0\"/lib && mkdir -p \"$0\"/lib && rsync -a --include '*.d.ts' --exclude '*.ts' --exclude '*.tsx' \"$0\"/sources/ \"$0\"/lib/ && node scripts/compile \"$@\"",
"test:lint": "eslint --max-warnings 0 \"./**/*.@(tsx|ts|js)\"",
"test:lint": "eslint --max-warnings 0 \"./**/*.@(tsx|ts|js|mjs)\"",
"test:unit": "jest",
"typecheck:all": "tsc -p ."
},
Expand Down

0 comments on commit 57ed709

Please sign in to comment.