Skip to content

Commit 8b417fa

Browse files
committed
initial commit
0 parents  commit 8b417fa

9 files changed

Lines changed: 3177 additions & 0 deletions

File tree

.eslintrc.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es2022: true,
6+
},
7+
parserOptions: {
8+
ecmaVersion: 'latest',
9+
sourceType: 'module',
10+
},
11+
ignorePatterns: ['node_modules/*', 'dist'],
12+
extends: ['eslint:recommended', 'plugin:import/recommended'],
13+
plugins: ['unused-imports'],
14+
rules: {
15+
'import/export': 'off',
16+
'import/newline-after-import': 'error',
17+
'import/order': [
18+
'error',
19+
{
20+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
21+
alphabetize: { order: 'asc' },
22+
},
23+
],
24+
'unused-imports/no-unused-imports': 'error',
25+
},
26+
settings: {
27+
'import/resolver': {
28+
node: {
29+
extensions: ['.js', '.ts', '.tsx'],
30+
paths: ['node_modules/', 'node_modules/@types'],
31+
},
32+
},
33+
},
34+
overrides: [
35+
{
36+
files: ['**/*.[jt]sx'],
37+
settings: { react: { version: 'detect' } },
38+
env: {
39+
browser: true,
40+
},
41+
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
42+
rules: {
43+
'react/prop-types': 'off',
44+
'react/react-in-jsx-scope': 'off',
45+
},
46+
},
47+
{
48+
files: ['**/*.ts?(x)'],
49+
parser: '@typescript-eslint/parser',
50+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
51+
rules: {
52+
'@typescript-eslint/no-unused-vars': ['error'],
53+
'@typescript-eslint/explicit-function-return-type': [
54+
'warn',
55+
{
56+
allowExpressions: true,
57+
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
58+
},
59+
],
60+
},
61+
},
62+
{
63+
files: ['**'],
64+
extends: ['prettier'],
65+
},
66+
],
67+
}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
examples/**/pnpm-lock.yaml
15+
examples/**/yarn.lock
16+
examples/**/package-lock.json
17+
18+
# Editor directories and files
19+
.vscode/*
20+
!.vscode/extensions.json
21+
.idea
22+
.DS_Store
23+
*.suo
24+
*.ntvs*
25+
*.njsproj
26+
*.sln
27+
*.sw?

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm-lock.yaml
2+
dist

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arrowParens": "avoid",
3+
"semi": false,
4+
"trailingComma": "es5",
5+
"singleQuote": true,
6+
"printWidth": 100,
7+
"tabWidth": 2
8+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# react-use-polling

package.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"name": "react-use-polling",
3+
"version": "1.0.0",
4+
"description": "Polling hooks for React.",
5+
"keywords": [
6+
"react",
7+
"reactjs",
8+
"polling"
9+
],
10+
"homepage": "https://github.com/hey3/react-use-polling#readme",
11+
"bugs": {
12+
"url": "https://github.com/hey3/react-use-polling/issues"
13+
},
14+
"license": "MIT",
15+
"author": "hey3",
16+
"main": "./dist/index.umd.js",
17+
"module": "./dist/index.mjs",
18+
"types": "./dist/types/index.d.ts",
19+
"repository": {
20+
"type": "git",
21+
"url": "git+https://github.com/hey3/react-use-polling.git"
22+
},
23+
"files": [
24+
"dist"
25+
],
26+
"exports": {
27+
".": {
28+
"types": "./dist/types/index.d.ts",
29+
"import": "./dist/index.mjs",
30+
"require": "./dist/index.umd.js"
31+
}
32+
},
33+
"sideEffects": false,
34+
"engines": {
35+
"node": ">= 16",
36+
"pnpm": "7"
37+
},
38+
"scripts": {
39+
"dev": "vite",
40+
"prebuild": "rimraf dist",
41+
"build": "tsc && vite build",
42+
"format": "prettier . --check --ignore-unknown",
43+
"format:fix": "prettier . --write --ignore-unknown",
44+
"lint": "eslint . --ext .js,.ts,.tsx",
45+
"lint:fix": "eslint . --fix --ext .js,.ts,.tsx",
46+
"test": "vitest run",
47+
"typecheck": "tsc --project tsconfig.json --pretty --noEmit --emitDeclarationOnly false --incremental false",
48+
"prepare": "npm run build"
49+
},
50+
"peerDependencies": {
51+
"react": ">= 16.8.0"
52+
},
53+
"devDependencies": {
54+
"@testing-library/react": "13.4.0",
55+
"@types/react": "18.0.26",
56+
"@typescript-eslint/eslint-plugin": "5.47.1",
57+
"@typescript-eslint/parser": "5.47.1",
58+
"@vitejs/plugin-react-swc": "3.0.1",
59+
"eslint": "8.30.0",
60+
"eslint-config-prettier": "8.5.0",
61+
"eslint-plugin-import": "2.26.0",
62+
"eslint-plugin-react": "7.31.11",
63+
"eslint-plugin-react-hooks": "4.6.0",
64+
"eslint-plugin-unused-imports": "2.0.0",
65+
"jsdom": "20.0.3",
66+
"prettier": "2.8.1",
67+
"react": "18.2.0",
68+
"react-dom": "18.2.0",
69+
"rimraf": "3.0.2",
70+
"typescript": "4.9.4",
71+
"vite": "4.0.3",
72+
"vitest": "0.26.2"
73+
}
74+
}

0 commit comments

Comments
 (0)