|
| 1 | +/** @type {import('eslint').Linter.Config} */ |
1 | 2 | module.exports = {
|
2 | 3 | parserOptions: {
|
3 | 4 | sourceType: 'script',
|
@@ -347,7 +348,15 @@ module.exports = {
|
347 | 348 | 'no-restricted-globals': 'off',
|
348 | 349 | 'no-restricted-imports': 'off',
|
349 | 350 | 'no-restricted-properties': 'off',
|
350 |
| - 'no-restricted-syntax': 'off', |
| 351 | + 'no-restricted-syntax': [ |
| 352 | + 'error', |
| 353 | + { |
| 354 | + selector: |
| 355 | + 'MemberExpression[object.name="globalThis"][property.name="process"]', |
| 356 | + message: |
| 357 | + "Never use `process` with `globalThis` because bundlers incorrectly replace it and doesn't tree shake unused code", |
| 358 | + }, |
| 359 | + ], |
351 | 360 | 'no-return-assign': 'error',
|
352 | 361 | 'no-return-await': 'error',
|
353 | 362 | 'no-script-url': 'error',
|
@@ -494,6 +503,8 @@ module.exports = {
|
494 | 503 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
|
495 | 504 | extends: ['plugin:import/typescript'],
|
496 | 505 | rules: {
|
| 506 | + // https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors |
| 507 | + 'no-undef': 'off', |
497 | 508 | //////////////////////////////////////////////////////////////////////////
|
498 | 509 | // `eslint-plugin-tsdoc` rule list based on `v0.2.x`
|
499 | 510 | // https://github.com/microsoft/tsdoc/tree/master/eslint-plugin
|
|
0 commit comments