Skip to content

Commit b7d6d3c

Browse files
committed
chore: linting fixes
1 parent fdbc4c2 commit b7d6d3c

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
'prettier/prettier': 'error',
3030
'@typescript-eslint/explicit-function-return-type': 'off',
3131
'@typescript-eslint/no-unused-vars': 'off',
32-
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
33-
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
32+
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
33+
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
3434
},
3535
};

tools/init.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* This file is taken from https://github.com/alexjoverm/typescript-library-starter and
77
* is almost identical to https://github.com/alexjoverm/typescript-library-starter/blob/master/tools/init.ts
88
*
9-
* I just made some modifications added some new functions.
9+
* I just made some modifications and added some new functions.
1010
* **/
1111

1212
/* eslint-disable @typescript-eslint/no-var-requires */
@@ -42,7 +42,7 @@ function removeItems() {
4242
const rmItems = rmDirs.concat(rmFiles);
4343
rm(
4444
'-rf',
45-
rmItems.map(f => resolve(__dirname, '..', f))
45+
rmItems.map((f) => resolve(__dirname, '..', f))
4646
);
4747
console.log(red(rmItems.join('\n')));
4848

@@ -63,7 +63,7 @@ function modifyContents(
6363
) {
6464
console.log(underline.white('Modified'));
6565

66-
const files = modifyFiles.map(f => resolve(__dirname, '..', f));
66+
const files = modifyFiles.map((f) => resolve(__dirname, '..', f));
6767
try {
6868
replace.sync({
6969
files,
@@ -83,7 +83,7 @@ function modifyContents(
8383
}
8484

8585
function modifyGitignoreFile(): void {
86-
const files = ['.gitignore'].map(f => resolve(__dirname, '..', f));
86+
const files = ['.gitignore'].map((f) => resolve(__dirname, '..', f));
8787
replace.sync({
8888
files,
8989
from: ['dist/', 'docs/'],
@@ -99,7 +99,7 @@ function modifyGitignoreFile(): void {
9999
function renameItems(libraryName: string) {
100100
console.log(underline.white('Renamed'));
101101

102-
renameFiles.forEach(function(files) {
102+
renameFiles.forEach(function (files) {
103103
// Files[0] is the current filename
104104
// Files[1] is the new name
105105
const newFilename = files[1].replace(/--libraryname--/g, libraryName);
@@ -133,9 +133,11 @@ function finalize() {
133133
delete pkg.scripts.postinstall;
134134

135135
// remove the dependencies that are required for the bootstrapping.
136-
['colors', 'prompt', 'replace-in-file', 'shelljs', 'ts-node'].forEach(dep => {
137-
delete pkg.devDependencies[dep];
138-
});
136+
['colors', 'prompt', 'replace-in-file', 'shelljs', 'ts-node'].forEach(
137+
(dep) => {
138+
delete pkg.devDependencies[dep];
139+
}
140+
);
139141

140142
writeFileSync(jsonPackage, JSON.stringify(pkg, null, 2));
141143
console.log(green('Postinstall script has been removed'));

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
"esModuleInterop": true,
1212
"skipLibCheck": true,
1313
"forceConsistentCasingInFileNames": true,
14+
"noFallthroughCasesInSwitch": true,
1415
"allowJs": false,
1516
"moduleResolution": "node",
1617
"resolveJsonModule": true,
17-
"jsx": "react",
18+
"jsx": "react-jsx",
1819
"baseUrl": "./src"
1920
},
2021
"include": ["src/**/*"],

0 commit comments

Comments
 (0)