Skip to content

Commit 584a81c

Browse files
committed
build: update react-scripts and switch to eslint
1 parent bebe0bd commit 584a81c

File tree

10 files changed

+2980
-2238
lines changed

10 files changed

+2980
-2238
lines changed

.eslintrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
extends: [
3+
'plugin:@typescript-eslint/recommended'
4+
],
5+
plugins: ['react', '@typescript-eslint', 'jest'],
6+
env: {
7+
browser: true,
8+
es6: true,
9+
jest: true,
10+
},
11+
globals: {
12+
Atomics: 'readonly',
13+
SharedArrayBuffer: 'readonly',
14+
},
15+
parser: '@typescript-eslint/parser',
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
ecmaVersion: 2018,
21+
sourceType: 'module',
22+
project: './tsconfig.json',
23+
},
24+
rules: {
25+
'linebreak-style': 'off',
26+
},
27+
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.sonarlint
2+
.eslintcache
23
node_modules
34
build

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
"version": "1.1.0",
55
"description": "Explore trending Github repositories directly in VSCode",
66
"engines": {
7-
"vscode": "^1.37.0"
7+
"vscode": "^1.38.0"
88
},
99
"keywords": [
1010
"github",
1111
"popular",
12+
"programming",
13+
"software",
1214
"trending",
1315
"repositories"
1416
],
1517
"publisher": "4gray",
18+
"license": "MIT",
1619
"icon": "assets/icon.png",
1720
"homepage": "https://4gray.github.io/vsc-github-trending",
1821
"galleryBanner": {
@@ -87,22 +90,29 @@
8790
"build": "./scripts/build-non-split.js && tsc -p tsconfig.extension.json",
8891
"test": "react-scripts test --env=jsdom",
8992
"eject": "react-scripts eject",
90-
"package": "vsce package --yarn"
93+
"package": "vsce package --yarn",
94+
"watch": "tsc -w -p ./"
9195
},
9296
"devDependencies": {
9397
"@types/jest": "^24.0.18",
9498
"@types/node": "^12.7.3",
9599
"@types/react": "^17.0.0",
96100
"@types/react-dom": "^17.0.0",
97101
"@types/vscode": "^1.37.0",
102+
"@typescript-eslint/eslint-plugin": "^4.13.0",
103+
"@typescript-eslint/parser": "^4.13.0",
104+
"eslint": "^7.18.0",
98105
"prettier": "^1.18.2",
99-
"react-scripts": "^3.1.1",
106+
"react-scripts": "^4.0.1",
100107
"rewire": "^4.0.1",
101108
"typescript": "^3.6.0"
102109
},
103110
"resolutions": {
104111
"@types/react": "^17.0.0"
105112
},
113+
"bugs": {
114+
"url": "https://github.com/4gray/vsc-github-trending/issues"
115+
},
106116
"repository": {
107117
"type": "git",
108118
"url": "https://github.com/4gray/vsc-github-trending.git"

src/components/DateSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './App.css';
1010
type DateSelectProps = {
1111
className: string;
1212
selectedInterval: string;
13-
onChange?(event: any): void;
13+
onChange(event: any): void;
1414
intervals?: any[];
1515
};
1616

src/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import DateSelect from './DateSelect';
66
import LanguageSelect from './LanguageSelect';
77

88
class Header extends React.Component<any> {
9-
public render() {
9+
render() {
1010
return (
1111
<Card className="Header">
1212
<Grid container={true} spacing={6}>

src/components/LanguageSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Language } from './App';
1111
type LanguageSelectProps = {
1212
className: string;
1313
selectedLanguage: string;
14-
onChange?(event: any): void;
14+
onChange(event: any): void;
1515
languages: Language[];
1616
};
1717

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import * as ReactDOM from 'react-dom';
33
import App from './components/App';
44
import './index.css';
55

6-
ReactDOM.render(<App />, document.getElementById('root') as HTMLElement);
6+
ReactDOM.render(<App />, document.getElementById('root'));

tsconfig.json

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"esModuleInterop": true,
8-
"allowSyntheticDefaultImports": true,
9-
"strict": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"module": "esnext",
12-
"moduleResolution": "node",
13-
"resolveJsonModule": true,
14-
"isolatedModules": true,
15-
"noEmit": true,
16-
"jsx": "preserve",
17-
"strictNullChecks": false
18-
},
19-
"include": ["src"]
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"esModuleInterop": true,
12+
"allowSyntheticDefaultImports": true,
13+
"strict": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"module": "esnext",
16+
"moduleResolution": "node",
17+
"resolveJsonModule": true,
18+
"isolatedModules": true,
19+
"noEmit": true,
20+
"jsx": "react",
21+
"strictNullChecks": false,
22+
"noFallthroughCasesInSwitch": true,
23+
"rootDir": "src"
24+
},
25+
"exclude": [
26+
"node_modules"
27+
],
28+
"include": [
29+
"src"
30+
]
2031
}

tslint.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)