Skip to content

Commit efb7324

Browse files
feat: created lib with default main settings
1 parent 2731a71 commit efb7324

35 files changed

Lines changed: 3056 additions & 10845 deletions

.editorconfig

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[*]
2+
indent_style = space
3+
end_of_line = lf
4+
indent_size = 2
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.md]
10+
indent_size = 4
11+
max_line_length = 0
12+
trim_trailing_whitespace = false
13+
14+
[{*.jhm, *.xslt, *.xul, *.rng, *.xsl, *.xsd, *.ant, *.tld, *.fxml, *.jrxml, *.xml, *.jnlp, *.wsdl}]
15+
indent_style = space
16+
indent_size = 4
17+
18+
[{.babelrc, .prettierrc, .stylelintrc, .eslintrc, jest.config, *.json, *.js, *.js.map, *.ts, *.tsx, *.jsb3, *.jsb2, *.bowerrc, *.graphqlconfig}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[.editorconfig]
23+
indent_style = space
24+
indent_size = 4
25+
26+
[*.less]
27+
indent_style = space
28+
indent_size = 2
29+
30+
[*.jshintrc]
31+
indent_style = space
32+
indent_size = 2
33+
34+
[*.jscsrc]
35+
indent_style = space
36+
indent_size = 2
37+
38+
[{tsconfig.lib.json, tsconfig.spec.json, tsconfig.app.json, tsconfig.json, tsconfig.e2e.json}]
39+
indent_style = space
40+
indent_size = 2
41+
42+
[*.ejs]
43+
indent_style = space
44+
indent_size = 4
45+
46+
[{.analysis_options, *.yml, *.yaml}]
47+
indent_style = space
48+
indent_size = 2

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
rollup.config.js
4+
.eslintrc.js
5+
.husky
6+
commitlint.config.js

.eslintrc.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
es2020: true,
7+
commonjs: true,
8+
},
9+
parser: '@typescript-eslint/parser',
10+
parserOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
project: './tsconfig.json',
17+
},
18+
plugins: ['react', 'prettier', '@typescript-eslint'],
19+
extends: [
20+
'airbnb',
21+
'airbnb-typescript',
22+
'airbnb/hooks',
23+
'plugin:@typescript-eslint/recommended',
24+
'plugin:react/recommended',
25+
'plugin:react-hooks/recommended',
26+
'plugin:jsx-a11y/recommended',
27+
'plugin:prettier/recommended',
28+
'plugin:import/errors',
29+
'plugin:import/warnings',
30+
'plugin:import/typescript',
31+
'prettier',
32+
],
33+
rules: {
34+
'react/jsx-filename-extension': [1, { extensions: ['.ts', '.tsx'] }],
35+
'react/prop-types': 'off',
36+
'react/jsx-props-no-spreading': ['error', { custom: 'ignore' }],
37+
'react/react-in-jsx-scope': 'off',
38+
'react/no-unescaped-entities': 'off',
39+
'react/jsx-no-constructed-context-values': 'off',
40+
'import/extensions': 'off',
41+
'import/no-unresolved': 'off',
42+
'import/prefer-default-export': 'off',
43+
'import/no-extraneous-dependencies': 'off',
44+
'import/no-cycle': [0, { ignoreExternal: true }],
45+
'implicit-arrow-linebreak': 'off',
46+
'arrow-parens': 'off',
47+
'comma-dangle': 'off',
48+
'global-require': 'off',
49+
'operator-linebreak': 'off',
50+
'no-restricted-exports': 'off',
51+
'react/function-component-definition': 'off',
52+
'no-use-before-define': ['error'],
53+
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
54+
'prefer-const': ['error'],
55+
'@typescript-eslint/comma-dangle': 'off',
56+
'@typescript-eslint/semi': 'off',
57+
'@typescript-eslint/explicit-module-boundary-types': 'off',
58+
'@typescript-eslint/explicit-function-return-type': 'off',
59+
'@typescript-eslint/no-var-requires': 'off',
60+
'@typescript-eslint/no-unused-vars': ['error'],
61+
'@typescript-eslint/no-use-before-define': [
62+
'error',
63+
{ functions: false, classes: false, variables: true },
64+
],
65+
'@typescript-eslint/no-empty-interface': [
66+
'error',
67+
{
68+
allowSingleExtends: true,
69+
},
70+
],
71+
},
72+
settings: {
73+
react: {
74+
version: 'detect',
75+
},
76+
},
77+
}

.gitignore

Lines changed: 175 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,181 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1+
# Created by https://www.toptal.com/developers/gitignore/api/node,git,visualstudiocode,react
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,git,visualstudiocode,react
23

3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
4+
### Git ###
5+
# Created by git for backups. To disable backups in Git:
6+
# $ git config --global mergetool.keepBackup false
7+
*.orig
78

8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
15-
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
9+
# Created by git when using merge tools for conflicts
10+
*.BACKUP.*
11+
*.BASE.*
12+
*.LOCAL.*
13+
*.REMOTE.*
14+
*_BACKUP_*.txt
15+
*_BASE_*.txt
16+
*_LOCAL_*.txt
17+
*_REMOTE_*.txt
2018

19+
### Node ###
20+
# Logs
21+
logs
22+
*.log
2123
npm-debug.log*
2224
yarn-debug.log*
2325
yarn-error.log*
26+
lerna-debug.log*
27+
.pnpm-debug.log*
28+
29+
# Diagnostic reports (https://nodejs.org/api/report.html)
30+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
31+
32+
# Runtime data
33+
pids
34+
*.pid
35+
*.seed
36+
*.pid.lock
37+
38+
# Directory for instrumented libs generated by jscoverage/JSCover
39+
lib-cov
40+
41+
# Coverage directory used by tools like istanbul
42+
coverage
43+
*.lcov
44+
45+
# nyc test coverage
46+
.nyc_output
47+
48+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
49+
.grunt
50+
51+
# Bower dependency directory (https://bower.io/)
52+
bower_components
53+
54+
# node-waf configuration
55+
.lock-wscript
56+
57+
# Compiled binary addons (https://nodejs.org/api/addons.html)
58+
build/Release
59+
60+
# Dependency directories
61+
node_modules/
62+
jspm_packages/
63+
64+
# Snowpack dependency directory (https://snowpack.dev/)
65+
web_modules/
66+
67+
# TypeScript cache
68+
*.tsbuildinfo
69+
70+
# Optional npm cache directory
71+
.npm
72+
73+
# Optional eslint cache
74+
.eslintcache
75+
76+
# Microbundle cache
77+
.rpt2_cache/
78+
.rts2_cache_cjs/
79+
.rts2_cache_es/
80+
.rts2_cache_umd/
81+
82+
# Optional REPL history
83+
.node_repl_history
84+
85+
# Output of 'npm pack'
86+
*.tgz
87+
88+
# Yarn Integrity file
89+
.yarn-integrity
90+
91+
# dotenv environment variables file
92+
.env
93+
.env.test
94+
.env.production
95+
96+
# parcel-bundler cache (https://parceljs.org/)
97+
.cache
98+
.parcel-cache
99+
100+
# Next.js build output
101+
.next
102+
out
103+
104+
# Nuxt.js build / generate output
105+
.nuxt
106+
dist
107+
108+
# Gatsby files
109+
.cache/
110+
# Comment in the public line in if your project uses Gatsby and not Next.js
111+
# https://nextjs.org/blog/next-9-1#public-directory-support
112+
# public
113+
114+
# vuepress build output
115+
.vuepress/dist
116+
117+
# Serverless directories
118+
.serverless/
119+
120+
# FuseBox cache
121+
.fusebox/
122+
123+
# DynamoDB Local files
124+
.dynamodb/
125+
126+
# TernJS port file
127+
.tern-port
128+
129+
# Stores VSCode versions used for testing VSCode extensions
130+
.vscode-test
131+
132+
# yarn v2
133+
.yarn/cache
134+
.yarn/unplugged
135+
.yarn/build-state.yml
136+
.yarn/install-state.gz
137+
.pnp.*
138+
139+
### Node Patch ###
140+
# Serverless Webpack directories
141+
.webpack/
142+
143+
# Optional stylelint cache
144+
.stylelintcache
145+
146+
# SvelteKit build / generate output
147+
.svelte-kit
148+
149+
### react ###
150+
.DS_*
151+
**/*.backup.*
152+
**/*.back.*
153+
154+
node_modules
155+
156+
*.sublime*
157+
158+
psd
159+
thumb
160+
sketch
161+
162+
### VisualStudioCode ###
163+
.vscode/*
164+
!.vscode/settings.json
165+
!.vscode/tasks.json
166+
!.vscode/launch.json
167+
!.vscode/extensions.json
168+
*.code-workspace
169+
170+
# Local History for Visual Studio Code
171+
.history/
172+
173+
### VisualStudioCode Patch ###
174+
# Ignore all local history of files
175+
.history
176+
.ionide
177+
178+
# Support for Project snippet scope
179+
!.vscode/*.code-snippets
180+
181+
# End of https://www.toptal.com/developers/gitignore/api/node,git,visualstudiocode,react

.husky/.gitignore

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

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
echo "Running commitlint..."
5+
yarn --silent commitlint --edit "$1"

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
echo "Running pre-commit checks..."
5+
yarn --silent lint-staged
6+
7+
echo "Running type checks..."
8+
yarn --silent type-check

.husky/pre-push

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
echo "Running pre-push checks..."
5+
yarn --silent prettier:check
6+
7+
echo "Running eslint checks..."
8+
yarn --silent eslint:check
9+
10+
echo "Running type checks..."
11+
yarn --silent type-check

.lintstagedrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"*.{ts,js,tsx,jsx}": [
3+
"prettier --loglevel warn --write",
4+
"eslint --fix --max-warnings 0"
5+
],
6+
"*.{css,md,mdx,json}}": ["prettier --loglevel warn --write"]
7+
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.4.0

0 commit comments

Comments
 (0)