Skip to content

Commit deac5f4

Browse files
authored
Integrating React App into extension src files and switching from 'Vite+Rollup' to Esbuild (#17919)
* Adding working esbuild * switching to esbuild in gulpfile * Fixing eslint config * chore: Remove commented out code in gulpfile.js * feat: Add loader configuration for TypeScript, JavaScript, and JSON files in gulpfile.js for building extension * Fixing theme on initial startup * chore: Fix casing in import statements for VscodeWebViewProvider * Fixing file name case * Refactor import statements for designer components * chore: Refactor import statements for designer components * add style file to ReactWebViewPanelController * chore: Bundle extension files and update localization in gulpfile.js * Adding back tsc for extension code * Fixing react warnings * chore: Refactor import statements for designer components * Fixing react view html * reverting changes to telemetry * adding back prelaunch task * Fixing gulp task names * Remove unused esbuild file * Remove unnecessary excluded paths from tsconfig.json * Update webview panel ID to 'mssql-react-webview' * restoring some old files * Adding typecheck to reactviews * Ignore reactviews folder in test coverage
1 parent 39d434c commit deac5f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6299
-6828
lines changed

.vscode/launch.json

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"sourceMaps": true,
3535
"outFiles": [
3636
"${workspaceRoot}/out/src/**/*.js",
37-
"${workspaceRoot}/myssql-react-app/dist/**/*.js"
3837
],
3938
"preLaunchTask": "build",
4039
"env": {

eslint.config.mjs

+115-90
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,102 @@ import notice from "eslint-plugin-notice";
55
import jsdoc from 'eslint-plugin-jsdoc';
66
import deprecationPlugin from "eslint-plugin-deprecation";
77
import { fixupPluginRules } from "@eslint/compat";
8+
import reactRefresh from "eslint-plugin-react-refresh";
9+
10+
const commonRules = {
11+
"notice/notice": [
12+
"error",
13+
{
14+
template: `/*---------------------------------------------------------------------------------------------
15+
* Copyright (c) Microsoft Corporation. All rights reserved.
16+
* Licensed under the MIT License. See License.txt in the project root for license information.
17+
*--------------------------------------------------------------------------------------------*/
18+
19+
`,
20+
}
21+
],
22+
"no-undef": "off",
23+
"no-unused-vars": "off",
24+
"constructor-super": "warn",
25+
"curly": "off",
26+
"eqeqeq": "warn",
27+
"no-buffer-constructor": "warn",
28+
"no-caller": "warn",
29+
"no-debugger": "warn",
30+
"no-duplicate-case": "warn",
31+
"no-duplicate-imports": "off",
32+
"no-eval": "warn",
33+
"no-async-promise-executor": "off",
34+
"no-extra-semi": "warn",
35+
"no-new-wrappers": "warn",
36+
"no-redeclare": "off",
37+
"no-sparse-arrays": "warn",
38+
"no-throw-literal": "off",
39+
"no-unsafe-finally": "warn",
40+
"no-unused-labels": "warn",
41+
"no-restricted-globals": [
42+
"warn",
43+
"name",
44+
"length",
45+
"event",
46+
"closed",
47+
"external",
48+
"status",
49+
"origin",
50+
"orientation",
51+
"context"
52+
], // non-complete list of globals that are easy to access unintentionally
53+
"no-var": "off",
54+
"semi": "off",
55+
"jsdoc/no-types": "warn",
56+
"no-restricted-syntax": [
57+
'warn',
58+
"Literal[raw='null']"
59+
],
60+
"@typescript-eslint/no-explicit-any": "warn",
61+
// Not really that useful, there are valid reasons to have empty functions
62+
"@typescript-eslint/no-empty-function": "off",
63+
"@typescript-eslint/no-inferrable-types": [
64+
"warn",
65+
{
66+
"ignoreParameters": true,
67+
"ignoreProperties": true
68+
}
69+
],
70+
"@typescript-eslint/no-unused-vars": [
71+
"warn",
72+
{
73+
"argsIgnorePattern": "^_"
74+
}
75+
],
76+
"deprecation/deprecation": "warn",
77+
"@typescript-eslint/no-floating-promises": [
78+
"warn",
79+
{
80+
"ignoreVoid": true
81+
}
82+
],
83+
"@typescript-eslint/naming-convention": [
84+
"warn",
85+
{
86+
"selector": "property",
87+
"modifiers": [
88+
"private"
89+
],
90+
"format": [
91+
"camelCase"
92+
],
93+
"leadingUnderscore": "require"
94+
}
95+
],
96+
};
97+
98+
899

9100
export default [
10101
{
11-
files: ['**/*.ts', '**/*.tsx'],
12-
ignores: ['src/prompts/**/*.ts', 'typings/**.*.d.ts'], // Ignore prompts files as they are copied from other repos
102+
files: ['**/*.ts'],
103+
ignores: ['src/prompts/**/*.ts', 'typings/**.*.d.ts', 'src/reactviews/**/*'], // Ignore prompts files as they are copied from other repos
13104
languageOptions: {
14105
parser: tseslint.parser,
15106
parserOptions: {
@@ -24,96 +115,30 @@ export default [
24115
["deprecation"]: fixupPluginRules(deprecationPlugin),
25116
},
26117
rules: {
27-
"notice/notice": [
28-
"error",
29-
{
30-
template: `/*---------------------------------------------------------------------------------------------
31-
* Copyright (c) Microsoft Corporation. All rights reserved.
32-
* Licensed under the MIT License. See License.txt in the project root for license information.
33-
*--------------------------------------------------------------------------------------------*/
34-
35-
`,
36-
onNonMatchingHeader: 'prepend',
37-
messages: {
38-
whenFailedToMatch: "Missing or incorrectly formatted copyright statement.",
39-
}
40-
},
41-
42-
],
43-
"no-undef": "off",
44-
"no-unused-vars": "off",
45-
"constructor-super": "warn",
46-
"curly": "off",
47-
"eqeqeq": "warn",
48-
"no-buffer-constructor": "warn",
49-
"no-caller": "warn",
50-
"no-debugger": "warn",
51-
"no-duplicate-case": "warn",
52-
"no-duplicate-imports": "off",
53-
"no-eval": "warn",
54-
"no-async-promise-executor": "off",
55-
"no-extra-semi": "warn",
56-
"no-new-wrappers": "warn",
57-
"no-redeclare": "off",
58-
"no-sparse-arrays": "warn",
59-
"no-throw-literal": "off",
60-
"no-unsafe-finally": "warn",
61-
"no-unused-labels": "warn",
62-
"no-restricted-globals": [
63-
"warn",
64-
"name",
65-
"length",
66-
"event",
67-
"closed",
68-
"external",
69-
"status",
70-
"origin",
71-
"orientation",
72-
"context"
73-
], // non-complete list of globals that are easy to access unintentionally
74-
"no-var": "off",
75-
"semi": "off",
76-
"jsdoc/no-types": "warn",
77-
"no-restricted-syntax": [
118+
...commonRules
119+
},
120+
}, {
121+
files: ['**/*.tsx'],
122+
languageOptions: {
123+
parser: '@typescript-eslint/parser',
124+
parserOptions: {
125+
project: './tsconfig.react.json',
126+
},
127+
},
128+
rules: {
129+
'react-refresh/only-export-components': [
78130
'warn',
79-
"Literal[raw='null']"
80-
],
81-
"@typescript-eslint/no-explicit-any": "warn",
82-
// Not really that useful, there are valid reasons to have empty functions
83-
"@typescript-eslint/no-empty-function": "off",
84-
"@typescript-eslint/no-inferrable-types": [
85-
"warn",
86-
{
87-
"ignoreParameters": true,
88-
"ignoreProperties": true
89-
}
131+
{ allowConstantExport: true },
90132
],
91-
"@typescript-eslint/no-unused-vars": [
92-
"warn",
93-
{
94-
"argsIgnorePattern": "^_"
95-
}
96-
],
97-
"deprecation/deprecation": "warn",
98-
"@typescript-eslint/no-floating-promises": [
99-
"warn",
100-
{
101-
"ignoreVoid": true
102-
}
103-
],
104-
"@typescript-eslint/naming-convention": [
105-
"warn",
106-
{
107-
"selector": "property",
108-
"modifiers": [
109-
"private"
110-
],
111-
"format": [
112-
"camelCase"
113-
],
114-
"leadingUnderscore": "require"
115-
}
116-
]
133+
...commonRules
117134
},
135+
plugins: {
136+
notice,
137+
jsdoc,
138+
['@typescript-eslint']: tseslint.plugin,
139+
// @ts-ignore
140+
["deprecation"]: fixupPluginRules(deprecationPlugin),
141+
['react-refresh']: reactRefresh
142+
}
118143
}
119144
];

0 commit comments

Comments
 (0)