Skip to content

Commit 0216b01

Browse files
feat: null check + lint
1 parent 4b5273c commit 0216b01

File tree

6 files changed

+163
-109
lines changed

6 files changed

+163
-109
lines changed

.eslintrc

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": [
4-
"standard",
5-
"standard-react"
6-
],
72
"env": {
8-
"es6": true
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true,
6+
"jest": true,
7+
"node": true
8+
},
9+
"settings": {
10+
"react": {
11+
"version": "detect"
12+
}
913
},
10-
"plugins": [
11-
"react"
14+
"extends": [
15+
"eslint:recommended",
16+
"plugin:react/recommended",
17+
"plugin:prettier/recommended"
1218
],
19+
"globals": {
20+
"Atomics": "readonly",
21+
"SharedArrayBuffer": "readonly"
22+
},
23+
"parser": "babel-eslint",
1324
"parserOptions": {
25+
"ecmaFeatures": {
26+
"jsx": true
27+
},
28+
"ecmaVersion": 2018,
1429
"sourceType": "module"
1530
},
31+
"plugins": ["import", "react", "react-hooks", "prettier"],
1632
"rules": {
17-
// don't force es6 functions to include space before paren
18-
"space-before-function-paren": 0,
19-
20-
// allow specifying true explicitly for boolean props
21-
"react/jsx-boolean-value": 0
33+
"react-hooks/rules-of-hooks": "error",
34+
"react-hooks/exhaustive-deps": "warn"
2235
}
2336
}

package-lock.json

Lines changed: 82 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"test:watch": "react-scripts test --env=jsdom",
2121
"build": "rollup -c",
2222
"start": "rollup -c -w",
23+
"lint": "eslint --ext .js --ext .jsx ./src",
24+
"lint:fix": "eslint --ext .js --ext .jsx ./src --fix",
25+
"prettier": "prettier --write 'src/**/*.{js,ts,html,tsx,jsx,json,scss,css,md}'",
2326
"prepare": "npm run build",
2427
"copy": "cpx ./config/package.json dist",
2528
"predeploy": "cd example && npm install && npm run build",
@@ -41,14 +44,16 @@
4144
"babel-preset-stage-0": "^6.24.1",
4245
"cpx": "^1.5.0",
4346
"cross-env": "^5.1.4",
44-
"eslint-config-standard": "^11.0.0",
45-
"eslint-config-standard-react": "^6.0.0",
46-
"eslint-plugin-import": "^2.13.0",
47-
"eslint-plugin-node": "^7.0.1",
48-
"eslint-plugin-promise": "^4.0.0",
49-
"eslint-plugin-react": "^7.16.0",
50-
"eslint-plugin-standard": "^3.1.0",
47+
"eslint": "^6.5.1",
48+
"eslint-config-prettier": "^6.3.0",
49+
"eslint-plugin-import": "^2.18.2",
50+
"eslint-plugin-node": "^10.0.0",
51+
"eslint-plugin-prettier": "^3.1.1",
52+
"eslint-plugin-promise": "^4.2.1",
53+
"eslint-plugin-react": "^7.15.1",
54+
"eslint-plugin-react-hooks": "^2.1.1",
5155
"gh-pages": "^1.2.0",
56+
"prettier": "1.18.2",
5257
"react": "^16.11.0",
5358
"react-dom": "^16.11.0",
5459
"react-scripts": "^3.2.0",

src/.eslintrc

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

src/clampy.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Clampy from './'
1+
import Clampy from "./";
22

3-
describe('Clampy', () => {
4-
it('is truthy', () => {
5-
expect(Clampy).toBeTruthy()
6-
})
7-
})
3+
describe("Clampy", () => {
4+
it("is truthy", () => {
5+
expect(Clampy).toBeTruthy();
6+
});
7+
});

0 commit comments

Comments
 (0)