-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: optimizing the build toolchain (#1788)
* chore: optimizing the build toolchain * chore: dealing with legacy eslint rule issues * chore: fix logic errors during refactoring * chore: generate type files in real time during the dev * chore: fix eslint issues * chore: sync to next branch
- Loading branch information
Showing
295 changed files
with
11,396 additions
and
2,259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# docs: https://github.com/browserslist/browserslist | ||
# see https://browsersl.ist/#q=defaults | ||
|
||
defaults | ||
partially supports es6-module | ||
iOS >= 10 | ||
ChromeAndroid >= 49 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
// see docs: https://eslint.org/docs/user-guide/configuring | ||
|
||
module.exports = { | ||
ignorePatterns: [ | ||
'node_modules', | ||
// | ||
'.commitlintrc.cjs', | ||
'.eslintrc.cjs', | ||
'.lintstagedrc.mjs', | ||
'babel.config.mjs', | ||
'rollup.config.mjs', | ||
'vite.config.mjs', | ||
// | ||
'packages/g-devtool', | ||
'packages/g-webgpu-compiler', | ||
'packages/site', | ||
// | ||
'build', | ||
'coverage', | ||
'esm', | ||
'lib', | ||
'dist', | ||
'rust', | ||
'__tests__', | ||
'scripts', | ||
'types', | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'airbnb', | ||
'airbnb/hooks', | ||
'airbnb-typescript', | ||
'plugin:prettier/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
plugins: ['eslint-plugin-tsdoc', 'jest'], | ||
root: true, | ||
env: { | ||
node: true, | ||
browser: true, | ||
'jest/globals': true, | ||
}, | ||
rules: { | ||
'import/no-cycle': 'warn', | ||
'import/no-duplicates': 'warn', | ||
'class-methods-use-this': 'warn', | ||
'no-plusplus': [ | ||
'warn', | ||
{ | ||
allowForLoopAfterthoughts: true, | ||
}, | ||
], | ||
'no-restricted-globals': 'warn', | ||
'no-continue': 'warn', | ||
'no-multi-assign': 'warn', | ||
'no-cond-assign': 'warn', | ||
'no-return-assign': 'warn', | ||
'no-new': 'warn', | ||
'new-cap': 'warn', | ||
'default-case': 'warn', | ||
'consistent-return': 'warn', | ||
'prefer-regex-literals': 'warn', | ||
'guard-for-in': 'warn', | ||
'no-underscore-dangle': 'off', | ||
'no-fallthrough': 'off', | ||
'no-empty': 'off', | ||
'no-param-reassign': 'off', | ||
'no-redeclare': 'off', | ||
'no-useless-escape': 'off', | ||
'no-case-declarations': 'off', | ||
'no-constant-condition': 'off', | ||
'import/prefer-default-export': 'off', | ||
'prefer-destructuring': 'off', | ||
'no-restricted-syntax': 'off', | ||
'no-bitwise': 'off', | ||
// | ||
'@typescript-eslint/naming-convention': 'warn', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-unsafe-member-access': 'warn', | ||
'@typescript-eslint/no-unsafe-assignment': 'warn', | ||
'@typescript-eslint/no-unsafe-return': 'warn', | ||
'@typescript-eslint/no-unsafe-argument': 'warn', | ||
'@typescript-eslint/no-unsafe-call': 'warn', | ||
'@typescript-eslint/no-unsafe-function-type': 'warn', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'warn', | ||
'@typescript-eslint/no-redundant-type-constituents': 'warn', | ||
'@typescript-eslint/no-floating-promises': 'warn', | ||
'@typescript-eslint/no-misused-promises': [ | ||
'warn', | ||
{ | ||
checksConditionals: false, | ||
}, | ||
], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ args: 'none', ignoreRestSiblings: true }, | ||
], | ||
'@typescript-eslint/no-unused-expressions': 'warn', | ||
'@typescript-eslint/no-base-to-string': 'warn', | ||
'@typescript-eslint/no-use-before-define': [ | ||
'error', | ||
{ functions: false, classes: false }, | ||
], | ||
'@typescript-eslint/no-redeclare': ['error'], | ||
'@typescript-eslint/restrict-template-expressions': 'warn', | ||
'@typescript-eslint/return-await': 'warn', | ||
'@typescript-eslint/default-param-last': 'warn', | ||
'@typescript-eslint/prefer-promise-reject-errors': 'off', | ||
'@typescript-eslint/no-empty-object-type': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/no-shadow': 'off', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/no-invalid-this': 'off', | ||
// not found | ||
'@typescript-eslint/lines-between-class-members': 'off', | ||
'@typescript-eslint/no-throw-literal': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
// | ||
'tsdoc/syntax': 'warn', | ||
}, | ||
globals: { G: true, window: true, document: true, module: true }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# see docs: https://prettier.io/docs/en/configuration.html | ||
|
||
semi: true | ||
singleQuote: true | ||
trailingComma: 'all' | ||
bracketSpacing: true | ||
arrowParens: 'always' | ||
printWidth: 80 | ||
proseWrap: 'never' | ||
endOfLine: 'auto' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// See https://babeljs.io/docs/en/configuration | ||
|
||
export default { | ||
assumptions: { | ||
privateFieldsAsProperties: true, | ||
setPublicClassFields: true, | ||
}, | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
// Exclude transforms that make all code slower | ||
exclude: ['transform-typeof-symbol'], | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
'@babel/preset-react', | ||
], | ||
plugins: [ | ||
[ | ||
'@babel/plugin-transform-typescript', | ||
{ | ||
allowDeclareFields: true, | ||
}, | ||
], | ||
// https://babeljs.io/docs/en/babel-plugin-transform-runtime | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
// By default, babel assumes babel/runtime version 7.0.0-beta.0, | ||
// explicitly resolving to match the provided helper functions. | ||
// https://github.com/babel/babel/issues/10261 | ||
version: '7.25.6', | ||
}, | ||
], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.