Skip to content

Commit faab638

Browse files
committed
init 🎉
0 parents  commit faab638

14 files changed

+7663
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
.vscode
3+
.idea
4+
5+
# npm
6+
node_modules
7+
npm-debug.log
8+
9+
# my
10+
/dist
11+
test-results
12+
playwright-report
13+
/todo.txt

.hooks/pre-commit

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
# Exit on any error
4+
set -euo pipefail
5+
6+
if [[ -n "${SKIP_GIT_HOOKS-}" ]]; then exit 0; fi
7+
8+
npx lint-staged --relative

.hooks/pre-push

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
# Exit on any error
4+
set -euo pipefail
5+
6+
if [[ -n "${SKIP_GIT_HOOKS-}" ]]; then exit 0; fi
7+
8+
npm run lint
9+
npm run prettier
10+
# npm run knip
11+
npm test
12+
13+
14+

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
playwright-report
3+
**/*.md

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Vitaliy Potapov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# playwright-network-cache
2+
Cache network requests in Playwright tests.
3+
4+
## License
5+
[MIT](https://github.com/vitalets/playwright-network-cache/blob/main/LICENSE)

eslint.config.mjs

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import globals from 'globals';
2+
import js from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
import playwright from 'eslint-plugin-playwright';
5+
6+
export default [
7+
{
8+
ignores: ['dist'],
9+
},
10+
js.configs.recommended,
11+
...tseslint.configs.recommended,
12+
{
13+
languageOptions: {
14+
globals: globals.node,
15+
},
16+
},
17+
{
18+
files: ['**/*.ts'],
19+
rules: {
20+
'no-console': 'error',
21+
22+
complexity: ['error', { max: 5 }],
23+
'max-depth': ['error', { max: 2 }],
24+
'max-nested-callbacks': ['error', { max: 2 }],
25+
'max-params': ['error', { max: 3 }],
26+
'max-statements': ['error', { max: 12 }, { ignoreTopLevelFunctions: false }],
27+
'max-len': ['error', { code: 120, ignoreUrls: true }],
28+
'max-lines': ['error', { max: 200, skipComments: true, skipBlankLines: true }],
29+
semi: ['error', 'always'],
30+
'no-multiple-empty-lines': ['error', { max: 1 }],
31+
'space-before-function-paren': [
32+
'error',
33+
{ anonymous: 'always', named: 'never', asyncArrow: 'always' },
34+
],
35+
'@typescript-eslint/triple-slash-reference': 0,
36+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
37+
'no-undef': 0,
38+
'no-empty-pattern': 0,
39+
},
40+
},
41+
{
42+
files: ['test/**/*.{ts,js}'],
43+
plugins: {
44+
playwright,
45+
},
46+
rules: {
47+
'max-params': 0,
48+
'no-empty-pattern': 0,
49+
'@typescript-eslint/no-empty-function': 0,
50+
'playwright/no-focused-test': 'error',
51+
},
52+
},
53+
];

lint-staged.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
'*.{ts,js}': ['eslint --fix', 'prettier --write --ignore-unknown'],
3+
'!(*.{ts,js})': ['prettier --write --ignore-unknown'],
4+
};

0 commit comments

Comments
 (0)