Skip to content

Commit 5c3dd97

Browse files
committed
build: update build tools
1 parent 541586e commit 5c3dd97

13 files changed

+566
-289
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false

.eslintignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
test/coverage/
2-
es/
3-
lib/
4-
umd/
1+
{
2+
"ignorePatterns": [".eslintrc.js"]
3+
}

.eslintrc

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

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
parserOptions: {
4+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5+
sourceType: 'module', // Allows for the use of imports
6+
ecmaFeatures: {
7+
jsx: true, // Allows for the parsing of JSX
8+
},
9+
},
10+
settings: {
11+
react: {
12+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
13+
},
14+
},
15+
extends: [
16+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
17+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
18+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
19+
],
20+
plugins: ['jsdoc', '@typescript-eslint', 'react', 'react-hooks'],
21+
rules: {
22+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
23+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
24+
},
25+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Enforce Unix newlines
2+
* text=auto eol=lf

.gitignore

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
2-
3-
# dependencies
4-
node_modules
5-
/node_modules
6-
7-
# testing
8-
/demo/dist
9-
10-
# testing
11-
/coverage
12-
13-
# production
14-
/es
15-
/lib
16-
/umd
17-
18-
# misc
19-
.DS_Store
20-
.idea/
21-
22-
npm-debug.log*
1+
node_modules/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: "all",
4+
singleQuote: true,
5+
printWidth: 100,
6+
tabWidth: 2
7+
};

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode"
3+
}

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@
3131
"README.md"
3232
],
3333
"scripts": {
34-
"build": "rollup -c"
34+
"build": "rollup -c",
35+
"lint": "eslint \"src/**/*.{js,ts,tsx}\""
36+
},
37+
"dependencies": {
38+
"@typescript-eslint/eslint-plugin": "^4.28.1",
39+
"@typescript-eslint/parser": "^4.28.1",
40+
"eslint-config-prettier": "^8.3.0",
41+
"eslint-plugin-jsdoc": "^35.4.1",
42+
"eslint-plugin-prettier": "^3.4.0",
43+
"prettier": "^2.3.2"
3544
},
36-
"dependencies": {},
3745
"peerDependencies": {
3846
"react": "^17.0.2"
3947
},

rollup.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ export default {
3030
clean: true,
3131
}),
3232
commonjs({
33-
include: ['node_modules/**'],
34-
namedExports: {
35-
'node_modules/react/react.js': ['Children', 'Component', 'PropTypes', 'createElement'],
36-
'node_modules/react-dom/index.js': ['render'],
37-
},
33+
include: ['node_modules/**']
3834
}),
3935
],
4036
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
},
2222
"include": ["src"],
2323
"exclude": ["node_modules", "dist"]
24-
}
24+
}

0 commit comments

Comments
 (0)