Skip to content

Commit e5a124a

Browse files
authored
dropkick ie8 from tgui (#6983)
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
1 parent b871cda commit e5a124a

File tree

16 files changed

+1948
-5128
lines changed

16 files changed

+1948
-5128
lines changed

tgui/.eslintignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@
33
/**/*.bundle.*
44
/**/*.chunk.*
55
/**/*.hot-update.*
6-
/packages/inferno/**
6+
**.lock
7+
**.log
8+
**.json
9+
**.svg
10+
**.scss
11+
**.md
12+
**.css
13+
**.txt
14+
**.woff2
15+
**.eot
16+
**.ttf
17+
/public

tgui/.eslintrc-sonar.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1 @@
1-
rules:
2-
# radar/cognitive-complexity: error
3-
radar/max-switch-cases: error
4-
radar/no-all-duplicated-branches: error
5-
radar/no-collapsible-if: error
6-
radar/no-collection-size-mischeck: error
7-
radar/no-duplicate-string: error
8-
radar/no-duplicated-branches: error
9-
radar/no-element-overwrite: error
10-
radar/no-extra-arguments: error
11-
radar/no-identical-conditions: error
12-
radar/no-identical-expressions: error
13-
radar/no-identical-functions: error
14-
radar/no-inverted-boolean-check: error
15-
radar/no-one-iteration-loop: error
16-
radar/no-redundant-boolean: error
17-
radar/no-redundant-jump: error
18-
radar/no-same-line-conditional: error
19-
radar/no-small-switch: error
20-
radar/no-unused-collection: error
21-
radar/no-use-of-empty-return-value: error
22-
radar/no-useless-catch: error
23-
radar/prefer-immediate-return: error
24-
radar/prefer-object-literal: error
25-
radar/prefer-single-boolean-return: error
26-
radar/prefer-while: error
1+
extends: 'plugin:sonarjs/recommended'

tgui/.eslintrc.yml

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ settings:
1717
react:
1818
version: '16.10'
1919
rules:
20-
2120
## Possible Errors
2221
## ----------------------------------------
2322
## Enforce “for” loop update clause moving the counter in the right
@@ -308,13 +307,16 @@ rules:
308307
## Enforce or disallow capitalization of the first letter of a comment
309308
# capitalized-comments: error
310309
## Require or disallow trailing commas
311-
comma-dangle: [error, {
312-
arrays: always-multiline,
313-
objects: always-multiline,
314-
imports: always-multiline,
315-
exports: always-multiline,
316-
functions: only-multiline, ## Optional on functions
317-
}]
310+
comma-dangle: [
311+
error,
312+
{
313+
arrays: always-multiline,
314+
objects: always-multiline,
315+
imports: always-multiline,
316+
exports: always-multiline,
317+
functions: only-multiline, ## Optional on functions
318+
},
319+
]
318320
## Enforce consistent spacing before and after commas
319321
comma-spacing: [error, { before: false, after: true }]
320322
## Enforce consistent comma style
@@ -334,7 +336,7 @@ rules:
334336
## Require or disallow named function expressions
335337
# func-names: error
336338
## Enforce the consistent use of either function declarations or expressions
337-
func-style: [error, expression]
339+
# func-style: [error, expression]
338340
## Enforce line breaks between arguments of a function call
339341
# function-call-argument-newline: error
340342
## Enforce consistent line breaks inside function parentheses
@@ -349,15 +351,15 @@ rules:
349351
## Enforce the location of arrow function bodies
350352
# implicit-arrow-linebreak: error
351353
## Enforce consistent indentation
352-
indent: [error, 2, { SwitchCase: 1 }]
354+
# indent: [error, 2, { SwitchCase: 1 }]
353355
## Enforce the consistent use of either double or single quotes in JSX
354356
## attributes
355-
jsx-quotes: [error, prefer-double]
357+
# jsx-quotes: [error, prefer-double]
356358
## Enforce consistent spacing between keys and values in object literal
357359
## properties
358-
key-spacing: [error, { beforeColon: false, afterColon: true }]
360+
# key-spacing: [error, { beforeColon: false, afterColon: true }]
359361
## Enforce consistent spacing before and after keywords
360-
keyword-spacing: [error, { before: true, after: true }]
362+
# keyword-spacing: [error, { before: true, after: true }]
361363
## Enforce position of line comments
362364
# line-comment-position: error
363365
## Enforce consistent linebreak style
@@ -369,15 +371,15 @@ rules:
369371
## Enforce a maximum depth that blocks can be nested
370372
# max-depth: error
371373
## Enforce a maximum line length
372-
max-len: [error, {
373-
code: 120,
374-
## Ignore imports
375-
ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
376-
ignoreUrls: true,
377-
ignoreRegExpLiterals: true,
378-
ignoreStrings: true,
379-
ignoreTemplateLiterals: true,
380-
}]
374+
# max-len: [error, {
375+
# code: 80,
376+
# ## Ignore imports
377+
# ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
378+
# ignoreUrls: true,
379+
# ignoreRegExpLiterals: true,
380+
# ignoreStrings: true,
381+
# ignoreTemplateLiterals: true,
382+
# }]
381383
## Enforce a maximum number of lines per file
382384
# max-lines: error
383385
## Enforce a maximum number of line of code in a function
@@ -414,7 +416,7 @@ rules:
414416
## Disallow mixed binary operators
415417
# no-mixed-operators: error
416418
## Disallow mixed spaces and tabs for indentation
417-
no-mixed-spaces-and-tabs: error
419+
# no-mixed-spaces-and-tabs: error
418420
## Disallow use of chained assignment expressions
419421
# no-multi-assign: error
420422
## Disallow multiple empty lines
@@ -440,7 +442,7 @@ rules:
440442
## Disallow ternary operators when simpler alternatives exist
441443
# no-unneeded-ternary: error
442444
## Disallow whitespace before properties
443-
no-whitespace-before-property: error
445+
# no-whitespace-before-property: error
444446
## Enforce the location of single-line statements
445447
# nonblock-statement-body-position: error
446448
## Enforce consistent line breaks inside braces
@@ -457,7 +459,7 @@ rules:
457459
## Require or disallow assignment operator shorthand where possible
458460
# operator-assignment: error
459461
## Enforce consistent linebreak style for operators
460-
operator-linebreak: [error, before]
462+
# operator-linebreak: [error, before]
461463
## Require or disallow padding within blocks
462464
# padded-blocks: error
463465
## Require or disallow padding lines between statements
@@ -482,11 +484,11 @@ rules:
482484
## Enforce consistent spacing before blocks
483485
space-before-blocks: [error, always]
484486
## Enforce consistent spacing before function definition opening parenthesis
485-
space-before-function-paren: [error, {
486-
anonymous: always,
487-
named: never,
488-
asyncArrow: always,
489-
}]
487+
# space-before-function-paren: [error, {
488+
# anonymous: always,
489+
# named: never,
490+
# asyncArrow: always,
491+
# }]
490492
## Enforce consistent spacing inside parentheses
491493
space-in-parens: [error, never]
492494
## Require spacing around infix operators
@@ -648,7 +650,7 @@ rules:
648650
## Enforce ES5 or ES6 class for React Components
649651
react/prefer-es6-class: error
650652
## Enforce that props are read-only
651-
react/prefer-read-only-props: error
653+
react/prefer-read-only-props: off
652654
## Enforce stateless React Components to be written as a pure function
653655
react/prefer-stateless-function: error
654656
## Prevent missing props validation in a React component definition
@@ -695,7 +697,7 @@ rules:
695697
react/jsx-closing-tag-location: error
696698
## Enforce or disallow newlines inside of curly braces in JSX attributes and
697699
## expressions (fixable)
698-
react/jsx-curly-newline: error
700+
# react/jsx-curly-newline: error
699701
## Enforce or disallow spaces inside of curly braces in JSX attributes and
700702
## expressions (fixable)
701703
react/jsx-curly-spacing: error
@@ -708,11 +710,11 @@ rules:
708710
## Enforce event handler naming conventions in JSX
709711
react/jsx-handler-names: error
710712
## Validate JSX indentation (fixable)
711-
react/jsx-indent: [error, 2, {
712-
checkAttributes: true,
713-
}]
713+
# react/jsx-indent: [error, 2, {
714+
# checkAttributes: true,
715+
# }]
714716
## Validate props indentation in JSX (fixable)
715-
react/jsx-indent-props: [error, 2]
717+
# react/jsx-indent-props: [error, 2]
716718
## Validate JSX has key prop when in array or iterator
717719
react/jsx-key: error
718720
## Validate JSX maximum depth

tgui/babel.config.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,32 @@ const createBabelConfig = options => {
88
const { presets = [], plugins = [], removeConsole } = options;
99
return {
1010
presets: [
11-
[require.resolve('@babel/preset-typescript'), {
12-
allowDeclareFields: true,
13-
}],
14-
[require.resolve('@babel/preset-env'), {
15-
modules: 'commonjs',
16-
useBuiltIns: 'entry',
17-
corejs: '3',
18-
spec: false,
19-
loose: true,
20-
targets: [],
21-
}],
11+
[
12+
require.resolve('@babel/preset-typescript'),
13+
{
14+
allowDeclareFields: true,
15+
},
16+
],
17+
[
18+
require.resolve('@babel/preset-env'),
19+
{
20+
modules: 'commonjs',
21+
useBuiltIns: 'entry',
22+
corejs: '3.3.2',
23+
spec: false,
24+
loose: true,
25+
targets: [],
26+
},
27+
],
2228
...presets,
2329
].filter(Boolean),
2430
plugins: [
25-
[require.resolve('@babel/plugin-proposal-class-properties'), {
26-
loose: true,
27-
}],
31+
[
32+
require.resolve('@babel/plugin-transform-class-properties'),
33+
{
34+
loose: true,
35+
},
36+
],
2837
require.resolve('@babel/plugin-transform-jscript'),
2938
require.resolve('babel-plugin-inferno'),
3039
removeConsole && require.resolve('babel-plugin-transform-remove-console'),
@@ -36,7 +45,7 @@ const createBabelConfig = options => {
3645

3746
module.exports = api => {
3847
api.cache(true);
39-
const mode = process.env['NODE_ENV'];
48+
const mode = process.env.NODE_ENV;
4049
return createBabelConfig({ mode });
4150
};
4251

tgui/package.json

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,54 @@
77
"packages/*"
88
],
99
"scripts": {
10-
"tgui:build": "webpack",
1110
"tgui:analyze": "webpack --analyze",
11+
"tgui:bench": "webpack --env TGUI_BENCH=1 && node packages/tgui-bench/index.js",
12+
"tgui:build": "BROWSERSLIST_IGNORE_OLD_DATA=true webpack",
1213
"tgui:dev": "node --experimental-modules packages/tgui-dev-server/index.js",
1314
"tgui:lint": "eslint packages --ext .js,.cjs,.ts,.tsx",
14-
"tgui:sonar": "eslint packages --ext .js,.cjs,.ts,.tsx -c .eslintrc-sonar.yml",
15-
"tgui:tsc": "tsc",
15+
"tgui:sonar": "eslint packages -c .eslintrc-sonar.yml",
1616
"tgui:test": "jest --watch",
1717
"tgui:test-simple": "CI=true jest --color",
1818
"tgui:test-ci": "CI=true jest --color --collect-coverage",
19-
"tgui:bench": "webpack --env TGUI_BENCH=1 && node packages/tgui-bench/index.js"
19+
"tgui:tsc": "tsc",
20+
"tgui:eslint-fix": "eslint --fix packages --ext .js,.cjs,.ts,.tsx"
2021
},
2122
"dependencies": {
22-
"@babel/core": "^7.15.0",
23-
"@babel/eslint-parser": "^7.25.9",
24-
"@babel/plugin-proposal-class-properties": "^7.14.5",
25-
"@babel/plugin-transform-jscript": "^7.14.5",
26-
"@babel/preset-env": "^7.15.0",
23+
"@babel/core": "^7.23.3",
24+
"@babel/eslint-parser": "^7.23.3",
25+
"@babel/plugin-transform-class-properties": "^7.23.3",
26+
"@babel/plugin-transform-jscript": "^7.23.3",
27+
"@babel/preset-env": "^7.23.3",
2728
"@babel/preset-typescript": "^7.23.3",
28-
"@types/jsdom": "^21.1.6",
29-
"@types/webpack-env": "^1.16.2",
30-
"@typescript-eslint/parser": "^8.12.2",
31-
"babel-jest": "^27.0.6",
32-
"babel-loader": "^8.2.2",
33-
"babel-plugin-inferno": "^6.3.0",
29+
"@types/jest": "^29.5.14",
30+
"@types/node": "^22.9.0",
31+
"@types/webpack-env": "^1.18.5",
32+
"@typescript-eslint/parser": "^8.13.0",
33+
"@typescript-eslint/utils": "^8.13.0",
34+
"babel-jest": "^29.7.0",
35+
"babel-loader": "^8.3.0",
36+
"babel-plugin-inferno": "^6.7.0",
3437
"babel-plugin-transform-remove-console": "^6.9.4",
3538
"common": "workspace:*",
36-
"css-loader": "^5.2.7",
39+
"css-loader": "^7.1.2",
40+
"esbuild-loader": "^4.2.2",
41+
"eslint": "^8.57.0",
42+
"eslint-plugin-react": "^7.34.1",
43+
"eslint-plugin-sonarjs": "^0.25.0",
44+
"eslint-plugin-unused-imports": "^3.1.0",
3745
"file-loader": "^6.2.0",
3846
"ignore-loader": "^0.1.2",
3947
"inferno": "^7.4.8",
48+
"jest": "29.7.0",
49+
"jest-circus": "27.0.6",
50+
"jest-environment-jsdom": "^29.7.0",
4051
"jsdom": "^16.7.0",
41-
"mini-css-extract-plugin": "^1.6.2",
52+
"mini-css-extract-plugin": "^2.9.2",
4253
"sass": "^1.37.5",
4354
"sass-loader": "^11.1.1",
4455
"style-loader": "^2.0.0",
45-
"terser-webpack-plugin": "^5.1.4",
4656
"typescript": "^5.6.3",
47-
"url-loader": "^4.1.1"
48-
},
49-
"devDependencies": {
50-
"@types/jest": "^29.5.14",
51-
"@types/webpack-bundle-analyzer": "^4",
52-
"eslint": "8.57.0",
53-
"eslint-plugin-react": "^7.37.2",
54-
"eslint-plugin-sonarjs": "^2.0.4",
55-
"eslint-plugin-unused-imports": "^4.1.4",
56-
"jest": "29.7.0",
57-
"jest-circus": "27.0.6",
58-
"jest-environment-jsdom": "^29.7.0",
57+
"url-loader": "^4.1.1",
5958
"webpack": "^5.95.0",
6059
"webpack-bundle-analyzer": "^4.10.2",
6160
"webpack-cli": "^5.1.4"

0 commit comments

Comments
 (0)