Skip to content

Commit

Permalink
chore: update eslint config (#17788)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jul 29, 2024
1 parent 461d37b commit 796eef3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 10 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down Expand Up @@ -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: [
Expand Down
3 changes: 0 additions & 3 deletions packages/vite/index.cjs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 796eef3

Please sign in to comment.