Skip to content

Commit 0731092

Browse files
feat: Improve linting (#242)
* feat: Improve linting * separate doc linting * fix tests --------- Co-authored-by: Nicola Marcacci Rossi <[email protected]>
1 parent a13b473 commit 0731092

24 files changed

+3337
-186
lines changed

.github/workflows/testing.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
run: npm ci
4646
- name: Lint
4747
run: npm run lint
48+
- name: Install docs dependencies
49+
run: cd docs && npm ci
50+
- name: Lint docs
51+
run: cd docs && npm run lint
4852
- name: Run tests
4953
run: npm run test
5054
env:

docs/.prettierignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

docs/.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@smartive/prettier-config"

docs/eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { config } from '@smartive/eslint-config';
2+
3+
/** @type {import('eslint').Linter.Config[]} */
4+
export default [
5+
...config('typescript'),
6+
{
7+
files: ['**/*.{ts,tsx,js,jsx,mjs}'],
8+
settings: {
9+
'import/resolver': {
10+
node: {
11+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
12+
},
13+
typescript: {
14+
alwaysTryTypes: true,
15+
},
16+
},
17+
},
18+
rules: {
19+
'import/no-unresolved': [
20+
'error',
21+
{
22+
ignore: ['^@theme', '^@docusaurus', '^@site'],
23+
},
24+
],
25+
'@typescript-eslint/no-require-imports': 'off',
26+
'@typescript-eslint/no-var-requires': 'off',
27+
'@typescript-eslint/no-unsafe-assignment': 'off',
28+
'@typescript-eslint/no-unsafe-member-access': 'off',
29+
},
30+
},
31+
];

0 commit comments

Comments
 (0)