Skip to content

Commit

Permalink
Merge branch 'main' into pr/aleen42/11599
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Oct 6, 2023
2 parents 1c3b5bc + a2e9fb5 commit b082765
Show file tree
Hide file tree
Showing 835 changed files with 22,748 additions and 10,616 deletions.
88 changes: 57 additions & 31 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
// @ts-check
const { builtinModules } = require('node:module')
const { defineConfig } = require('eslint-define-config')
const pkg = require('./package.json')

module.exports = defineConfig({
root: true,
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:n/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:regexp/recommended',
],
ignorePatterns: ['packages/create-vite/template-**'],
plugins: ['import', 'regexp'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
ecmaVersion: 2022,
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
Expand All @@ -29,37 +32,32 @@ module.exports = defineConfig({
},
],

'node/no-missing-import': [
'error',
{
allowModules: ['types', 'estree', 'less', 'sass', 'stylus'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'],
},
],
'node/no-missing-require': [
'n/no-process-exit': 'off',
'n/no-missing-import': 'off',
'n/no-missing-require': [
'error',
{
// for try-catching yarn pnp
allowModules: ['pnpapi', 'vite'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'],
},
],
'node/no-extraneous-import': [
'n/no-extraneous-import': [
'error',
{
allowModules: ['vite', 'less', 'sass', 'vitest'],
allowModules: ['vite', 'less', 'sass', 'vitest', 'unbuild'],
},
],
'node/no-extraneous-require': [
'n/no-extraneous-require': [
'error',
{
allowModules: ['vite'],
},
],
'node/no-deprecated-api': 'off',
'node/no-unpublished-import': 'off',
'node/no-unpublished-require': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'n/no-deprecated-api': 'off',
'n/no-unpublished-import': 'off',
'n/no-unpublished-require': 'off',
'n/no-unsupported-features/es-syntax': 'off',

'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR
Expand All @@ -73,15 +71,24 @@ module.exports = defineConfig({
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off', // maybe we should turn this on in a new PR
'@typescript-eslint/no-unused-vars': 'off', // maybe we should turn this on in a new PR
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
{ prefer: 'type-imports', disallowTypeAnnotations: false },
],
// disable rules set in @typescript-eslint/stylistic v6 that wasn't set in @typescript-eslint/recommended v5 and which conflict with current code
// maybe we should turn them on in a new PR
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-tslint-comment': 'off',
'@typescript-eslint/consistent-generic-constructors': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/prefer-function-type': 'off',

'import/no-nodejs-modules': [
'error',
Expand Down Expand Up @@ -118,7 +125,7 @@ module.exports = defineConfig({
{
files: 'packages/vite/**/*.*',
rules: {
'node/no-restricted-require': [
'n/no-restricted-require': [
'error',
Object.keys(
require('./packages/vite/package.json').devDependencies,
Expand All @@ -139,37 +146,41 @@ module.exports = defineConfig({
},
},
{
files: ['packages/vite/src/types/**', '*.spec.ts'],
files: [
'packages/vite/src/types/**',
'packages/vite/scripts/**',
'*.spec.ts',
],
rules: {
'node/no-extraneous-import': 'off',
'n/no-extraneous-import': 'off',
},
},
{
files: ['packages/create-vite/template-*/**', '**/build.config.ts'],
rules: {
'no-undef': 'off',
'node/no-missing-import': 'off',
'n/no-missing-import': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
{
files: ['playground/**'],
rules: {
'node/no-extraneous-import': 'off',
'node/no-extraneous-require': 'off',
'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'n/no-extraneous-import': 'off',
'n/no-extraneous-require': 'off',
'n/no-missing-import': 'off',
'n/no-missing-require': 'off',
// engine field doesn't exist in playgrounds
'node/no-unsupported-features/es-builtins': [
'n/no-unsupported-features/es-builtins': [
'error',
{
version: '^14.18.0 || >=16.0.0',
version: pkg.engines.node,
},
],
'node/no-unsupported-features/node-builtins': [
'n/no-unsupported-features/node-builtins': [
'error',
{
version: '^14.18.0 || >=16.0.0',
version: pkg.engines.node,
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
Expand All @@ -185,6 +196,21 @@ module.exports = defineConfig({
'@typescript-eslint/no-empty-function': 'off',
},
},
{
files: ['playground/**'],
excludedFiles: [
'playground/ssr-resolve/**',
'playground/**/*{commonjs,cjs}*/**',
'playground/**/*{commonjs,cjs}*',
'playground/**/*dep*/**',
'playground/resolve/browser-module-field2/index.web.js',
'playground/resolve/browser-field/**',
'playground/tailwind/**', // blocked by https://github.com/postcss/postcss-load-config/issues/239
],
rules: {
'import/no-commonjs': 'error',
},
},
{
files: [
'playground/tsconfig-json/**',
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 @@ -32,7 +32,7 @@ body:
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers`
description: Output of `npx envinfo --system --npmPackages '{vite,@vitejs/*,rollup}' --binaries --browsers`
render: shell
placeholder: System, Binaries, Browsers
validations:
Expand Down
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "\U0001F4DA Documentation"
description: Suggest a change or new page to be added to vitejs.dev
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this issue!
- type: checkboxes
id: documentation_is
attributes:
label: Documentation is
options:
- label: Missing
- label: Outdated
- label: Confusing
- label: Not sure?
- type: textarea
id: description
attributes:
label: Explain in Detail
description: A clear and concise description of your suggestion. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: The description of ... page is not clear. I thought it meant ... but it wasn't.
validations:
required: true
- type: textarea
id: suggestion
attributes:
label: Your Suggestion for Changes
validations:
required: true
- type: input
id: reproduction
attributes:
label: Reproduction
description: If you have a reproduction, 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.
placeholder: Reproduction URL
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce
description: Please provide any reproduction steps that may need to be described. E.g. if it happens only when running the dev or build script make sure it's clear which one to use.
placeholder: Run `npm install` followed by `npm run dev`
6 changes: 1 addition & 5 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
"labels": ["dependencies"],
"ignorePaths": ["**/__tests__/**"],
"pin": false,
"rangeStrategy": "bump",
"node": false,
"packageRules": [
{
"depTypeList": ["peerDependencies"],
Expand All @@ -19,9 +18,6 @@
"typescript",

// breaking changes
"source-map", // `source-map:v0.7.0+` needs more investigation
"dotenv-expand", // `dotenv-expand:6.0.0+` has breaking changes (#6858)
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
"miniflare", // `miniflare:v2.0.0+` only supports node 16.7
],
}
Loading

0 comments on commit b082765

Please sign in to comment.