Skip to content

Commit

Permalink
Merge branch 'vitejs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenzhenChange committed Jun 17, 2022
2 parents 82a193c + d402ad3 commit d7ebcf1
Show file tree
Hide file tree
Showing 1,533 changed files with 65,877 additions and 24,847 deletions.
42 changes: 0 additions & 42 deletions .circleci/config.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .eslintignore
@@ -0,0 +1,4 @@
dist
playground-temp
temp

177 changes: 177 additions & 0 deletions .eslintrc.cjs
@@ -0,0 +1,177 @@
// @ts-check
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
root: true,
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:@typescript-eslint/recommended'
],
plugins: ['import'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
'no-debugger': ['error'],
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-process-exit': 'off',
'no-useless-escape': 'off',
'prefer-const': [
'warn',
{
destructuring: 'all'
}
],

'node/no-missing-import': [
'error',
{
allowModules: ['types', 'estree', 'less', 'sass', 'stylus'],
tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts']
}
],
'node/no-missing-require': [
'error',
{
// for try-catching yarn pnp
allowModules: ['pnpapi', 'vite'],
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',
{
allowModules: ['vite', 'less', 'sass', 'vitest']
}
],
'node/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',

'@typescript-eslint/ban-ts-comment': 'off', // TODO: we should turn this on in a new PR
'@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true }
],
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['arrowFunctions'] }
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR
'@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' }
],

'import/no-duplicates': 'error',
'import/order': 'error',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false
}
]
},
overrides: [
{
files: ['packages/vite/src/node/**'],
rules: {
'no-console': ['error']
}
},
{
files: ['packages/vite/types/**', '*.spec.ts'],
rules: {
'node/no-extraneous-import': 'off'
}
},
{
files: ['packages/plugin-*/**/*'],
rules: {
'no-restricted-globals': ['error', 'require', '__dirname', '__filename']
}
},
{
files: ['playground/**'],
rules: {
'node/no-extraneous-import': 'off',
'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.6.0'
}
],
'node/no-unsupported-features/node-builtins': [
'error',
{
version: '>=14.6.0'
}
]
}
},
{
files: ['packages/create-vite/template-*/**', '**/build.config.ts'],
rules: {
'node/no-missing-import': 'off'
}
},
{
files: ['playground/**', '*.js'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
},
{
files: ['*.d.ts'],
rules: {
'@typescript-eslint/triple-slash-reference': 'off'
}
},
{
files: 'packages/vite/**/*.*',
rules: {
'no-restricted-globals': ['error', 'require', '__dirname', '__filename']
}
}
],
reportUnusedDisableDirectives: true
})
77 changes: 0 additions & 77 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto eol=lf
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

0 comments on commit d7ebcf1

Please sign in to comment.