fix(eslint): also ignore .pnpmfile.cjs / .cjs (CommonJS by design)
After the .venv ignore fix landed (commit 9be49acb), a different
lint error surfaced in CI run 64:
/dashboards/admin-web/.pnpmfile.cjs
1:12 error A `require()` style import is forbidden @typescript-eslint/no-require-imports
2:14 error A `require()` style import is forbidden @typescript-eslint/no-require-imports
`.pnpmfile.cjs` is a pnpm hook that MUST be CommonJS; it cannot
use ESM imports because pnpm loads it via Node's require() and the
file is not part of the TypeScript source tree at all. The
@typescript-eslint/no-require-imports rule should never apply to
*.cjs files.
Added two ignore patterns to the root config:
'**/.pnpmfile.cjs'
'**/*.cjs'
The broader '*.cjs' glob also covers any future CommonJS config
files (next.config.cjs, postcss.config.cjs, etc.).
This commit is contained in:
parent
539e64e5d6
commit
1be38bef28
@ -25,6 +25,11 @@ export default [
|
|||||||
// these, but the root config is what runs in CI).
|
// these, but the root config is what runs in CI).
|
||||||
'**/playwright-report/**',
|
'**/playwright-report/**',
|
||||||
'**/test-results/**',
|
'**/test-results/**',
|
||||||
|
// .pnpmfile.cjs / .cjs config files use CommonJS require() by
|
||||||
|
// design and must not be linted with the TypeScript ESM rule set
|
||||||
|
// that forbids require-style imports.
|
||||||
|
'**/.pnpmfile.cjs',
|
||||||
|
'**/*.cjs',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user