Skip to content

Commit

Permalink
Merge branch 'main' into feat/wsl2-watch-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Aug 11, 2022
2 parents 608181c + b1bbc5b commit 4261caf
Show file tree
Hide file tree
Showing 306 changed files with 4,921 additions and 2,181 deletions.
71 changes: 44 additions & 27 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
const { builtinModules } = require('node:module')
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
Expand Down Expand Up @@ -42,18 +43,6 @@ module.exports = defineConfig({
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts']
}
],
'node/no-restricted-require': [
'error',
Object.keys(require('./packages/vite/package.json').devDependencies).map(
(d) => ({
name: d,
message:
`devDependencies can only be imported using ESM syntax so ` +
`that they are included in the rollup bundle. If you are trying to ` +
`lazy load a dependency, use (await import('dependency')).default instead.`
})
)
],
'node/no-extraneous-import': [
'error',
{
Expand Down Expand Up @@ -93,6 +82,10 @@ module.exports = defineConfig({
{ prefer: 'type-imports' }
],

'import/no-nodejs-modules': [
'error',
{ allow: builtinModules.map((mod) => `node:${mod}`) }
],
'import/no-duplicates': 'error',
'import/order': 'error',
'sort-imports': [
Expand All @@ -107,6 +100,30 @@ module.exports = defineConfig({
]
},
overrides: [
{
files: ['packages/**'],
excludedFiles: '**/__tests__/**',
rules: {
'no-restricted-globals': ['error', 'require', '__dirname', '__filename']
}
},
{
files: 'packages/vite/**/*.*',
rules: {
'node/no-restricted-require': [
'error',
Object.keys(
require('./packages/vite/package.json').devDependencies
).map((d) => ({
name: d,
message:
`devDependencies can only be imported using ESM syntax so ` +
`that they are included in the rollup bundle. If you are trying to ` +
`lazy load a dependency, use (await import('dependency')).default instead.`
}))
]
}
},
{
files: ['packages/vite/src/node/**'],
rules: {
Expand All @@ -120,9 +137,11 @@ module.exports = defineConfig({
}
},
{
files: ['packages/plugin-*/**/*'],
files: ['packages/create-vite/template-*/**', '**/build.config.ts'],
rules: {
'no-restricted-globals': ['error', 'require', '__dirname', '__filename']
'no-undef': 'off',
'node/no-missing-import': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
},
{
Expand All @@ -132,30 +151,34 @@ module.exports = defineConfig({
'node/no-extraneous-require': 'off',
'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'no-undef': 'off',
// engine field doesn't exist in playgrounds
'node/no-unsupported-features/es-builtins': [
'error',
{
version: '>=14.18.0'
version: '^14.18.0 || >=16.0.0'
}
],
'node/no-unsupported-features/node-builtins': [
'error',
{
version: '>=14.18.0'
version: '^14.18.0 || >=16.0.0'
}
]
],
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
},
{
files: ['packages/create-vite/template-*/**', '**/build.config.ts'],
files: ['playground/**'],
excludedFiles: '**/__tests__/**',
rules: {
'node/no-missing-import': 'off'
'no-undef': 'off',
'no-empty': 'off',
'no-constant-condition': 'off',
'@typescript-eslint/no-empty-function': 'off'
}
},
{
files: ['playground/**', '*.js'],
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
Expand All @@ -165,12 +188,6 @@ module.exports = defineConfig({
rules: {
'@typescript-eslint/triple-slash-reference': 'off'
}
},
{
files: 'packages/vite/**/*.*',
rules: {
'no-restricted-globals': ['error', 'require', '__dirname', '__filename']
}
}
],
reportUnusedDisableDirectives: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
id: reproduction
attributes:
label: Reproduction
description: Please provide a link via [vite.new](https://vite.new/) or a link to a repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
description: Please provide a link via [vite.new](https://vite.new/) or a link to a repo that can reproduce the problem you ran into. `npm create vite@latest` and `npm create vite-extra@latest` (for SSR or library repros) can be used as a starter template. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required ([Why?](https://antfu.me/posts/why-reproductions-are-required)). If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
placeholder: Reproduction URL and steps
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: Install Playwright
# does not need to explictly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium

- name: Build
Expand Down
Loading

0 comments on commit 4261caf

Please sign in to comment.