chore: update eslint config (#17788)

This commit is contained in:
Bjorn Lu 2024-07-30 04:14:34 +08:00 committed by GitHub
parent 461d37b947
commit 796eef3af1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -133,7 +133,8 @@ export default tseslint.config(
},
],
'regexp/no-contradiction-with-assertion': 'error',
'regexp/prefer-regexp-exec': 'error',
'regexp/prefer-regexp-test': 'error',
// in some cases using explicit letter-casing is more performant than the `i` flag
'regexp/use-ignore-case': 'off',
},
@ -221,6 +222,14 @@ export default tseslint.config(
'n/no-extraneous-import': 'off',
},
},
{
name: 'disables/vite/cjs',
files: ['packages/vite/index.cjs'],
rules: {
'no-restricted-globals': 'off',
'n/no-missing-require': 'off',
},
},
{
name: 'disables/create-vite/templates',
files: [

View File

@ -1,12 +1,9 @@
/* eslint-disable no-restricted-globals */
warnCjsUsage()
// type utils
module.exports.defineConfig = (config) => config
// proxy cjs utils (sync functions)
// eslint-disable-next-line n/no-missing-require -- will be generated by build
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
// async functions, can be redirect from ESM build