Skip to content

Commit

Permalink
dropkick ie8 from tgui (#6983)
Browse files Browse the repository at this point in the history
we wont be needing these polyfills since ie8 is dead
also updates all* packages to "the last version before tg swapped to
react"
*not including sass since thats a 'major' change
  • Loading branch information
LetterN authored Feb 6, 2025
1 parent b871cda commit e5a124a
Show file tree
Hide file tree
Showing 16 changed files with 1,948 additions and 5,128 deletions.
13 changes: 12 additions & 1 deletion tgui/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
/**/*.bundle.*
/**/*.chunk.*
/**/*.hot-update.*
/packages/inferno/**
**.lock
**.log
**.json
**.svg
**.scss
**.md
**.css
**.txt
**.woff2
**.eot
**.ttf
/public
27 changes: 1 addition & 26 deletions tgui/.eslintrc-sonar.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
rules:
# radar/cognitive-complexity: error
radar/max-switch-cases: error
radar/no-all-duplicated-branches: error
radar/no-collapsible-if: error
radar/no-collection-size-mischeck: error
radar/no-duplicate-string: error
radar/no-duplicated-branches: error
radar/no-element-overwrite: error
radar/no-extra-arguments: error
radar/no-identical-conditions: error
radar/no-identical-expressions: error
radar/no-identical-functions: error
radar/no-inverted-boolean-check: error
radar/no-one-iteration-loop: error
radar/no-redundant-boolean: error
radar/no-redundant-jump: error
radar/no-same-line-conditional: error
radar/no-small-switch: error
radar/no-unused-collection: error
radar/no-use-of-empty-return-value: error
radar/no-useless-catch: error
radar/prefer-immediate-return: error
radar/prefer-object-literal: error
radar/prefer-single-boolean-return: error
radar/prefer-while: error
extends: 'plugin:sonarjs/recommended'
74 changes: 38 additions & 36 deletions tgui/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ settings:
react:
version: '16.10'
rules:

## Possible Errors
## ----------------------------------------
## Enforce “for” loop update clause moving the counter in the right
Expand Down Expand Up @@ -308,13 +307,16 @@ rules:
## Enforce or disallow capitalization of the first letter of a comment
# capitalized-comments: error
## Require or disallow trailing commas
comma-dangle: [error, {
arrays: always-multiline,
objects: always-multiline,
imports: always-multiline,
exports: always-multiline,
functions: only-multiline, ## Optional on functions
}]
comma-dangle: [
error,
{
arrays: always-multiline,
objects: always-multiline,
imports: always-multiline,
exports: always-multiline,
functions: only-multiline, ## Optional on functions
},
]
## Enforce consistent spacing before and after commas
comma-spacing: [error, { before: false, after: true }]
## Enforce consistent comma style
Expand All @@ -334,7 +336,7 @@ rules:
## Require or disallow named function expressions
# func-names: error
## Enforce the consistent use of either function declarations or expressions
func-style: [error, expression]
# func-style: [error, expression]
## Enforce line breaks between arguments of a function call
# function-call-argument-newline: error
## Enforce consistent line breaks inside function parentheses
Expand All @@ -349,15 +351,15 @@ rules:
## Enforce the location of arrow function bodies
# implicit-arrow-linebreak: error
## Enforce consistent indentation
indent: [error, 2, { SwitchCase: 1 }]
# indent: [error, 2, { SwitchCase: 1 }]
## Enforce the consistent use of either double or single quotes in JSX
## attributes
jsx-quotes: [error, prefer-double]
# jsx-quotes: [error, prefer-double]
## Enforce consistent spacing between keys and values in object literal
## properties
key-spacing: [error, { beforeColon: false, afterColon: true }]
# key-spacing: [error, { beforeColon: false, afterColon: true }]
## Enforce consistent spacing before and after keywords
keyword-spacing: [error, { before: true, after: true }]
# keyword-spacing: [error, { before: true, after: true }]
## Enforce position of line comments
# line-comment-position: error
## Enforce consistent linebreak style
Expand All @@ -369,15 +371,15 @@ rules:
## Enforce a maximum depth that blocks can be nested
# max-depth: error
## Enforce a maximum line length
max-len: [error, {
code: 120,
## Ignore imports
ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}]
# max-len: [error, {
# code: 80,
# ## Ignore imports
# ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
# ignoreUrls: true,
# ignoreRegExpLiterals: true,
# ignoreStrings: true,
# ignoreTemplateLiterals: true,
# }]
## Enforce a maximum number of lines per file
# max-lines: error
## Enforce a maximum number of line of code in a function
Expand Down Expand Up @@ -414,7 +416,7 @@ rules:
## Disallow mixed binary operators
# no-mixed-operators: error
## Disallow mixed spaces and tabs for indentation
no-mixed-spaces-and-tabs: error
# no-mixed-spaces-and-tabs: error
## Disallow use of chained assignment expressions
# no-multi-assign: error
## Disallow multiple empty lines
Expand All @@ -440,7 +442,7 @@ rules:
## Disallow ternary operators when simpler alternatives exist
# no-unneeded-ternary: error
## Disallow whitespace before properties
no-whitespace-before-property: error
# no-whitespace-before-property: error
## Enforce the location of single-line statements
# nonblock-statement-body-position: error
## Enforce consistent line breaks inside braces
Expand All @@ -457,7 +459,7 @@ rules:
## Require or disallow assignment operator shorthand where possible
# operator-assignment: error
## Enforce consistent linebreak style for operators
operator-linebreak: [error, before]
# operator-linebreak: [error, before]
## Require or disallow padding within blocks
# padded-blocks: error
## Require or disallow padding lines between statements
Expand All @@ -482,11 +484,11 @@ rules:
## Enforce consistent spacing before blocks
space-before-blocks: [error, always]
## Enforce consistent spacing before function definition opening parenthesis
space-before-function-paren: [error, {
anonymous: always,
named: never,
asyncArrow: always,
}]
# space-before-function-paren: [error, {
# anonymous: always,
# named: never,
# asyncArrow: always,
# }]
## Enforce consistent spacing inside parentheses
space-in-parens: [error, never]
## Require spacing around infix operators
Expand Down Expand Up @@ -648,7 +650,7 @@ rules:
## Enforce ES5 or ES6 class for React Components
react/prefer-es6-class: error
## Enforce that props are read-only
react/prefer-read-only-props: error
react/prefer-read-only-props: off
## Enforce stateless React Components to be written as a pure function
react/prefer-stateless-function: error
## Prevent missing props validation in a React component definition
Expand Down Expand Up @@ -695,7 +697,7 @@ rules:
react/jsx-closing-tag-location: error
## Enforce or disallow newlines inside of curly braces in JSX attributes and
## expressions (fixable)
react/jsx-curly-newline: error
# react/jsx-curly-newline: error
## Enforce or disallow spaces inside of curly braces in JSX attributes and
## expressions (fixable)
react/jsx-curly-spacing: error
Expand All @@ -708,11 +710,11 @@ rules:
## Enforce event handler naming conventions in JSX
react/jsx-handler-names: error
## Validate JSX indentation (fixable)
react/jsx-indent: [error, 2, {
checkAttributes: true,
}]
# react/jsx-indent: [error, 2, {
# checkAttributes: true,
# }]
## Validate props indentation in JSX (fixable)
react/jsx-indent-props: [error, 2]
# react/jsx-indent-props: [error, 2]
## Validate JSX has key prop when in array or iterator
react/jsx-key: error
## Validate JSX maximum depth
Expand Down
39 changes: 24 additions & 15 deletions tgui/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,32 @@ const createBabelConfig = options => {
const { presets = [], plugins = [], removeConsole } = options;
return {
presets: [
[require.resolve('@babel/preset-typescript'), {
allowDeclareFields: true,
}],
[require.resolve('@babel/preset-env'), {
modules: 'commonjs',
useBuiltIns: 'entry',
corejs: '3',
spec: false,
loose: true,
targets: [],
}],
[
require.resolve('@babel/preset-typescript'),
{
allowDeclareFields: true,
},
],
[
require.resolve('@babel/preset-env'),
{
modules: 'commonjs',
useBuiltIns: 'entry',
corejs: '3.3.2',
spec: false,
loose: true,
targets: [],
},
],
...presets,
].filter(Boolean),
plugins: [
[require.resolve('@babel/plugin-proposal-class-properties'), {
loose: true,
}],
[
require.resolve('@babel/plugin-transform-class-properties'),
{
loose: true,
},
],
require.resolve('@babel/plugin-transform-jscript'),
require.resolve('babel-plugin-inferno'),
removeConsole && require.resolve('babel-plugin-transform-remove-console'),
Expand All @@ -36,7 +45,7 @@ const createBabelConfig = options => {

module.exports = api => {
api.cache(true);
const mode = process.env['NODE_ENV'];
const mode = process.env.NODE_ENV;
return createBabelConfig({ mode });
};

Expand Down
59 changes: 29 additions & 30 deletions tgui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,54 @@
"packages/*"
],
"scripts": {
"tgui:build": "webpack",
"tgui:analyze": "webpack --analyze",
"tgui:bench": "webpack --env TGUI_BENCH=1 && node packages/tgui-bench/index.js",
"tgui:build": "BROWSERSLIST_IGNORE_OLD_DATA=true webpack",
"tgui:dev": "node --experimental-modules packages/tgui-dev-server/index.js",
"tgui:lint": "eslint packages --ext .js,.cjs,.ts,.tsx",
"tgui:sonar": "eslint packages --ext .js,.cjs,.ts,.tsx -c .eslintrc-sonar.yml",
"tgui:tsc": "tsc",
"tgui:sonar": "eslint packages -c .eslintrc-sonar.yml",
"tgui:test": "jest --watch",
"tgui:test-simple": "CI=true jest --color",
"tgui:test-ci": "CI=true jest --color --collect-coverage",
"tgui:bench": "webpack --env TGUI_BENCH=1 && node packages/tgui-bench/index.js"
"tgui:tsc": "tsc",
"tgui:eslint-fix": "eslint --fix packages --ext .js,.cjs,.ts,.tsx"
},
"dependencies": {
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-transform-jscript": "^7.14.5",
"@babel/preset-env": "^7.15.0",
"@babel/core": "^7.23.3",
"@babel/eslint-parser": "^7.23.3",
"@babel/plugin-transform-class-properties": "^7.23.3",
"@babel/plugin-transform-jscript": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@types/jsdom": "^21.1.6",
"@types/webpack-env": "^1.16.2",
"@typescript-eslint/parser": "^8.12.2",
"babel-jest": "^27.0.6",
"babel-loader": "^8.2.2",
"babel-plugin-inferno": "^6.3.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"@types/webpack-env": "^1.18.5",
"@typescript-eslint/parser": "^8.13.0",
"@typescript-eslint/utils": "^8.13.0",
"babel-jest": "^29.7.0",
"babel-loader": "^8.3.0",
"babel-plugin-inferno": "^6.7.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"common": "workspace:*",
"css-loader": "^5.2.7",
"css-loader": "^7.1.2",
"esbuild-loader": "^4.2.2",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-sonarjs": "^0.25.0",
"eslint-plugin-unused-imports": "^3.1.0",
"file-loader": "^6.2.0",
"ignore-loader": "^0.1.2",
"inferno": "^7.4.8",
"jest": "29.7.0",
"jest-circus": "27.0.6",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^16.7.0",
"mini-css-extract-plugin": "^1.6.2",
"mini-css-extract-plugin": "^2.9.2",
"sass": "^1.37.5",
"sass-loader": "^11.1.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.4",
"typescript": "^5.6.3",
"url-loader": "^4.1.1"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/webpack-bundle-analyzer": "^4",
"eslint": "8.57.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-sonarjs": "^2.0.4",
"eslint-plugin-unused-imports": "^4.1.4",
"jest": "29.7.0",
"jest-circus": "27.0.6",
"jest-environment-jsdom": "^29.7.0",
"url-loader": "^4.1.1",
"webpack": "^5.95.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4"
Expand Down
Loading

0 comments on commit e5a124a

Please sign in to comment.