Skip to content

Commit

Permalink
Migrate to Vite (#1423)
Browse files Browse the repository at this point in the history
Co-authored-by: Yehuda Katz <wycats@gmail.com>
  • Loading branch information
NullVoxPopuli and wycats authored May 9, 2023
1 parent b613617 commit e0086c1
Show file tree
Hide file tree
Showing 409 changed files with 5,485 additions and 4,303 deletions.
365 changes: 128 additions & 237 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -8,239 +9,23 @@
"prettier"
],
"ignorePatterns": ["dist", "ts-dist", "node_modules", "tmp", "**/node_modules", "**/dist"],
"overrides": [
{
"extends": [
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:qunit/recommended",
"prettier"
],
"files": [
"packages/@glimmer/compiler/**/*.ts",
"packages/@glimmer/syntax/lib/**/*.ts",
"packages/@glimmer/syntax/index.ts"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"object": false
}
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"ignoreRestArgs": true
}
],
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
// this is handled by import/errors
"n/no-extraneous-import": "off",
"prefer-const": ["off"],
"qunit/no-global-expect": ["off"]
}
},
{
"files": ["**/*.d.ts"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"n/no-missing-import": "off",
"no-useless-constructor": "off"
}
},
// node files
{
"env": {
"es6": true,
"node": true
},
"files": [
".eslintrc.js",
"ember-cli-build.js",
"testem.js",
"testem-browserstack.js",
"bin/**/*.js",
"bin/**/*.mjs",
"build/**/*.js",
"server/**/*.js"
],
"rules": {
"no-console": "off"
}
},
// bin scripts
{
"files": ["bin/**/*.js"],
"rules": {
"n/no-unsupported-features/es-syntax": [
"error",
{
"ignores": [],
"version": ">=16.0.0"
}
],
"n/shebang": "off"
}
},
{
"env": {
"browser": true,
"es6": true
},
"extends": ["plugin:import/errors"],
"files": ["benchmark/**/*.js", "benchmark/**/*.d.ts"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"n/no-unsupported-features/es-syntax": "off",
"no-console": "off"
}
},
{
"env": {
"es6": true,
"mocha": true,
"node": true
},
"files": ["packages/build-utils/@glimmer/vm-babel-plugins/test/**/*.js"],
"rules": {
"n/no-unpublished-import": "off",
"n/no-unsupported-features/es-syntax": "off",
"no-console": "off"
}
},
// source packages
{
"files": ["packages/**/*.js"],
"parserOptions": {
"sourceType": "module"
}
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".js", ".ts", ".d.ts"]
},
// TypeScript source packages
{
"files": ["packages/**/*.ts"],
// "parserOptions": {
// "project": "./tsconfig.json",
// "sourceType": "module",
// "tsconfigRootDir": __dirname
// },
"rules": {
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"format": ["camelCase", "PascalCase"],
"leadingUnderscore": "allow",
"selector": ["parameter"]
},
{
"format": null,
"modifiers": ["const"],
"selector": "variable"
},
{
"format": ["PascalCase"],
"leadingUnderscore": "allow",
"selector": ["typeLike"]
},
{
"format": ["PascalCase", "UPPER_CASE"],
"selector": ["typeAlias"]
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unused-vars": "off",
"consistent-return": "off",
"consistent-this": "off",
"constructor-super": "off",
"default-case": "off",
"dot-notation": "off",
"func-name-matching": "off",
"func-style": "off",
"guard-for-in": "off",
"line-comment-position": "off",
"n/no-missing-import": "off",
"n/no-unsupported-features/es-syntax": "off",
"n/no-unsupported-features/node-builtins": "off",
"new-cap": "off",
"no-bitwise": "off",
"no-case-declarations": "off",
"no-constant-condition": "off",
"no-continue": "off",
"no-debugger": "error",
"no-duplicate-imports": "off",
"no-else-return": "off",
"no-empty": "off",
"no-fallthrough": "off",
"no-inline-comments": "off",
"no-invalid-this": "off",
"no-labels": "off",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-multi-assign": "off",
"no-negated-condition": "off",
"no-new": "off",
"no-script-url": "off",
"no-shadow": "off",
"no-throw-literal": "off",
"no-undef-init": "off",
"no-unneeded-ternary": "off",
"no-unsafe-finally": "off",
"no-unused-expressions": "error",
"no-useless-call": "off",
"no-useless-concat": "off",
"no-useless-constructor": "off",
"no-useless-escape": "off",
"no-useless-return": "off",
"no-warning-comments": "off",
"object-shorthand": "off",
"operator-assignment": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"spaced-comment": "off"
}
"import/resolver": {
"typescript": {}
},
{
// these packages need to be fixed to avoid these warnings, but in the
// meantime we should not regress the other packages
"files": [
// this specific test imports from @glimmer/runtime (causing a cyclic
// dependency), it should either be refactored to use the interfaces
// directly (instead of the impls) or moved into @glimmer/runtime
"packages/@glimmer/reference/test/template-test.ts"
],
"rules": {
"n/no-extraneous-import": "warn"
}
"node": {
"allowModules": ["@glimmer/debug", "@glimmer/local-debug-flags"],
"tryExtensions": [".js", ".ts", ".d.ts", ".json"]
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"project": ["tsconfig.json", "tsconfig.build.json", "packages/@glimmer/vm/tsconfig.json"]
},
"plugins": ["@typescript-eslint", "prettier", "qunit", "simple-import-sort", "unused-imports"],
"root": true,
"rules": {
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-function": "error",
Expand Down Expand Up @@ -423,16 +208,122 @@
"vars-on-top": "error",
"yoda": ["error", "never"]
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".js", ".ts", ".d.ts"]
"overrides": [
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:qunit/recommended",
"prettier"
],
"files": [
"packages/@glimmer/compiler/**/*.ts",
"packages/@glimmer/syntax/lib/**/*.ts",
"packages/@glimmer/syntax/index.ts"
],
"rules": {
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"object": false
}
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"ignoreRestArgs": true
}
],
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
// this is handled by import/errors
"n/no-extraneous-import": "off",
"prefer-const": ["off"],
"qunit/no-global-expect": ["off"]
}
},
"import/resolver": {
"typescript": {}
{
"files": ["**/*.d.ts"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"n/no-missing-import": "off",
"no-useless-constructor": "off"
}
},
"node": {
"allowModules": ["@glimmer/debug", "@glimmer/local-debug-flags"],
"tryExtensions": [".js", ".ts", ".d.ts", ".json"]

// bin scripts
{
"files": ["bin/**/*.js"],
"rules": {
"n/no-unsupported-features/es-syntax": [
"error",
{
"ignores": [],
"version": ">=16.0.0"
}
],
"n/shebang": "off"
}
},
{
"env": {
"browser": true,
"es6": true
},
"extends": ["plugin:import/errors"],
"files": ["benchmark/**/*.js", "benchmark/**/*.d.ts"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"n/no-unsupported-features/es-syntax": "off",
"no-console": "off"
}
},
{
"env": {
"es6": true,
"mocha": true,
"node": true
},
"files": ["packages/build-utils/@glimmer/vm-babel-plugins/test/**/*.js"],
"rules": {
"n/no-unpublished-import": "off",
"n/no-unsupported-features/es-syntax": "off",
"no-console": "off"
}
},
// source packages
{
"files": ["packages/**/*.js"],
"parserOptions": {
"sourceType": "module"
}
},

{
// these packages need to be fixed to avoid these warnings, but in the
// meantime we should not regress the other packages
"files": [
// this specific test imports from @glimmer/runtime (causing a cyclic
// dependency), it should either be refactored to use the interfaces
// directly (instead of the impls) or moved into @glimmer/runtime
"packages/@glimmer/reference/test/template-test.ts"
],
"rules": {
"n/no-extraneous-import": "warn"
}
}
}
]
}
Loading

0 comments on commit e0086c1

Please sign in to comment.