Skip to content

Commit eae3890

Browse files
committed
chore: uprade react version and apply eslint fixes
1 parent b7d6d3c commit eae3890

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ module.exports = {
2323
'prettier/@typescript-eslint',
2424
'plugin:prettier/recommended',
2525
'plugin:@typescript-eslint/eslint-recommended',
26-
'plugin:@typescript-eslint/recommended',
2726
],
2827
rules: {
2928
'prettier/prettier': 'error',
3029
'@typescript-eslint/explicit-function-return-type': 'off',
3130
'@typescript-eslint/no-unused-vars': 'off',
3231
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
3332
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
33+
'react/react-in-jsx-scope': 'off', // suppress errors for missing 'import React' in files
3434
},
3535
};

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"npm": ">=6"
3535
},
3636
"peerDependencies": {
37-
"prop-types": "^15.7.2",
3837
"react": "^17.0.1",
3938
"react-dom": "17.0.1"
4039
},
@@ -66,8 +65,8 @@
6665
"lint-staged": "^10.5.3",
6766
"prettier": "^2.2.1",
6867
"prompt": "^1.1.0",
69-
"react": "^16.12.0",
70-
"react-dom": "^16.13.0",
68+
"react": "^17.0.1",
69+
"react-dom": "^17.0.1",
7170
"replace-in-file": "^6.1.0",
7271
"rollup": "^2.35.1",
7372
"rollup-plugin-commonjs": "^10.1.0",

src/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import React, { useEffect } from 'react';
1+
import { useEffect } from 'react';
22

33
interface Props {
44
message?: string;
55
}
66
/**
77
* Main Component
88
*/
9-
function Main(props: Props) {
9+
function Greeting(props: Props) {
1010
useEffect(() => {
1111
console.log('Incoming message: ', props.message);
1212
}, [props.message]);
13+
1314
return <div>{props.message ?? 'No Message'}</div>;
1415
}
1516

16-
export default Main;
17+
export default Greeting;

tools/init.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const { basename, resolve } = require('path');
1616
const replace = require('replace-in-file');
1717
const { readFileSync, writeFileSync } = require('fs');
1818
const { cyan, green, red, underline, yellow } = require('colors');
19-
const { fork } = require('child_process');
2019
const _prompt = require('prompt');
2120
const { mv, rm, which, exec } = require('shelljs');
2221

@@ -29,7 +28,6 @@ const modifyFiles = [
2928
'README.md',
3029
'CODE_OF_CONDUCT.md',
3130
];
32-
const renameFiles: Array<string> = [];
3331

3432
/**
3533
* Removes items from the project that aren't needed after the initial setup
@@ -91,28 +89,6 @@ function modifyGitignoreFile(): void {
9189
});
9290
}
9391

94-
/**
95-
* Renames any template files to the new library name
96-
*
97-
* @param libraryName
98-
*/
99-
function renameItems(libraryName: string) {
100-
console.log(underline.white('Renamed'));
101-
102-
renameFiles.forEach(function (files) {
103-
// Files[0] is the current filename
104-
// Files[1] is the new name
105-
const newFilename = files[1].replace(/--libraryname--/g, libraryName);
106-
mv(
107-
resolve(__dirname, '..', files[0]),
108-
resolve(__dirname, '..', newFilename)
109-
);
110-
console.log(cyan(files[0] + ' => ' + newFilename));
111-
});
112-
113-
console.log('\n');
114-
}
115-
11692
/**
11793
* Calls any external programs to finish setting up the library
11894
*/

0 commit comments

Comments
 (0)