Skip to content

Commit 525f24f

Browse files
committed
Tried to update dependencies but encountered conflicts, did not pursue at this time. Beginning to address depreciated code and clean up.
1 parent 0fe5435 commit 525f24f

File tree

4 files changed

+419
-1382
lines changed

4 files changed

+419
-1382
lines changed

.eslintrc.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
{
22
"extends": ["plugin:react/recommended", "plugin:@typescript-eslint/recommended", "airbnb-base"],
33
"parserOptions": {
4+
"ecmaVersion": 2024,
5+
"sourceType": "module",
46
"ecmaFeatures": {
57
"jsx": true
6-
},
7-
"ecmaVersion": 2018,
8-
"sourceType": "module"
8+
}
99
},
10-
"plugins": ["import", "react", "jest", "jsx-a11y", "babel"],
11-
"parser": "@babel/eslint-parser",
10+
"plugins": ["@typescript-eslint", "import", "react", "jsx-a11y"],
11+
"parser": "@typescript-eslint/parser",
1212
"env": {
1313
"browser": true,
1414
"node": true,
15-
"es6": true,
16-
"jest": true
15+
"es6": true
1716
},
1817
"rules": {
1918
"class-methods-use-this": "off",
20-
"linebreak-style": 0
19+
"linebreak-style": 0,
20+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
21+
"no-unused-vars": "off", // disable the base rule, use the TypeScript version
22+
"no-console": "warn", // ensure that debugging statements are not left in the final version of the code
23+
"prefer-const": "warn", // enforces that variables that are never reassigned should be declared as const
24+
"no-undef": "warn" // catch references to variables that have not been declared
2125
}
2226
}

app/src/utils/exportProject.util.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import createGatsbyApp from './createGatsbyApp.util';
66
/**
77
* Handles the exporting of projects in various configurations based on user selections.
88
* This function supports the creation of Classic React applications, Next.js applications,
9-
* Gatsby.js applications, and a basic export of component files without full application scaffolding.
9+
* Gatsby.js apps, and a basic export of component files without full application scaffolding.
1010
*
1111
* @param {string} path - The directory path where the project should be exported.
1212
* @param {string} appName - The name of the application to be created.
1313
* @param {number} genOption - Indicates the type of generation:
1414
* 0 for only component files, 1 for complete application setup.
15-
* @param {string} projectType - Specifies the type of project: 'Classic React', 'Next.js', or 'Gatsby.js'.
15+
* @param {string} projectType - Specifies project type: 'Classic React', 'Next.js', or 'Gatsby.js'.
1616
* @param {any[]} components - An array of components to be included in the project.
17-
* @param {number[]} rootComponents - An array of indices identifying which components are root components.
17+
* @param {number[]} rootComponents - An array of indices identifying root components.
1818
* @param {boolean} [tests] - Optional. Whether to include test setups in the generated application.
1919
* @returns {void} - This function does not return a value but will log the outcome of the file writing operation to the console.
2020
*/
@@ -25,35 +25,35 @@ const exportProject = (
2525
projectType: string,
2626
components: any,
2727
rootComponents: number[],
28-
tests?: boolean
28+
tests?: boolean,
2929
): void => {
3030
// Create fully functional classic react application
3131
if (genOption === 1 && projectType === 'Classic React') {
3232
createApplicationUtil({
3333
path,
3434
appName,
3535
components,
36-
testchecked: tests
36+
testchecked: tests,
3737
}).catch((err) => console.log(err));
38-
} // export all component files, but don't create all application files
39-
else if (genOption === 0) {
38+
} else if (genOption === 0) {
39+
// export all component files, but don't create all application files
4040
createFiles(components, path, appName, false);
41-
} // Create fully functional Next.js and Gatsby.js application files
42-
else if (genOption === 1 && projectType === 'Next.js') {
41+
} else if (genOption === 1 && projectType === 'Next.js') {
42+
// Create fully functional Next.js and Gatsby.js application files
4343
createNextApp({
4444
path,
4545
appName,
4646
components,
4747
rootComponents,
48-
testchecked: tests
48+
testchecked: tests,
4949
}).catch((err) => console.log(err));
5050
} else if (genOption === 1 && projectType === 'Gatsby.js') {
5151
createGatsbyApp({
5252
path,
5353
appName,
5454
components,
5555
rootComponents,
56-
testchecked: tests
56+
testchecked: tests,
5757
}).catch((err) => console.log(err));
5858
}
5959
};

0 commit comments

Comments
 (0)