Skip to content

Commit d24b179

Browse files
committed
lint
1 parent 1ed2503 commit d24b179

File tree

7 files changed

+326
-387
lines changed

7 files changed

+326
-387
lines changed

.eslintrc.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
extends:
22
- "eslint:recommended"
3-
- "plugin:@typescript-eslint/eslint-recommended"
43
- "plugin:@typescript-eslint/recommended"
5-
- "plugin:prettier/recommended"
6-
- "prettier"
7-
- "prettier/@typescript-eslint"
4+
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
85
plugins:
96
- "@typescript-eslint"
107
- "prettier"
118

129
env:
1310
node: true
1411
es6: true
15-
parser: "@typescript-eslint/parser"
12+
1613
parserOptions:
1714
sourceType: module
1815
project: "./tsconfig.json"
1916
rules:
2017
semi: error
21-
node/no-missing-import: error
2218
prettier/prettier: error
23-
quotes:
24-
- warn
25-
- single
26-
- double
27-
no-unused-vars:
28-
- 2
29-
- argsIgnorePattern: "^_"
30-
- ignore-pattern: "^_"
31-
"@typescript-eslint/no-unused-vars": ["error"]
19+
"@typescript-eslint/no-explicit-any": off
20+
"@typescript-eslint/no-unsafe-assignment": off
21+
"@typescript-eslint/no-unsafe-member-access": off
22+
"@typescript-eslint/no-unsafe-return": off

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Description
2+
Please include a summary of the change or the feature being introduced. Detail how it addresses the issue at hand, and why this approach was chosen.
3+
4+
## Type of Change
5+
- [ ] Bug fix
6+
- [ ] New feature
7+
- [ ] Breaking change
8+
- [ ] Reword
9+
- [ ] The other
10+
11+
### Impact Area
12+
Please describe the areas of the project that may be affected by your changes. This can include specific files, components, or functionalities. Highlight any areas that reviewers should pay special attention to.
13+
14+
## How Has This Been Tested?
15+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
16+
17+
- [ ] Visual operation check - `yarn storybook`
18+
- [ ] Test - `yarn test`
19+
- [ ] Lint - `yarn eslint`
20+
21+
## Additional Context
22+
Add any other context or screenshots about the pull request here.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"analyze": "rm -rf ./dist && webpack --analyze",
1212
"storybook": "storybook dev -p 6006",
1313
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
14+
"eslint": "eslint --ext .ts,.tsx src",
1415
"build-storybook": "storybook build",
1516
"build-default-css": "lessc --clean-css ./src/styles/default.less ./dist/styles/default.css",
1617
"build-dark-css": "lessc --clean-css ./src/styles/dark.less ./dist/styles/dark.css",
@@ -60,14 +61,13 @@
6061
"@types/react": "^16.9.49",
6162
"@types/react-syntax-highlighter": "^15.5.5",
6263
"@types/storybook__react": "^5.2.1",
63-
"@typescript-eslint/eslint-plugin": "^4.14.2",
64-
"@typescript-eslint/parser": "^4.14.2",
64+
"@typescript-eslint/eslint-plugin": "^7.2.0",
65+
"@typescript-eslint/parser": "^7.2.0",
6566
"babel-loader": "^8.2.2",
66-
"eslint": "^7.19.0",
67-
"eslint-config-prettier": "^7.2.0",
68-
"eslint-plugin-prettier": "^3.3.1",
69-
"eslint-plugin-storybook": "^0.8.0",
70-
"file-loader": "^6.2.0",
67+
"eslint": "^8.57.0",
68+
"eslint-config-prettier": "^9.1.0",
69+
"eslint-plugin-node": "^11.1.0",
70+
"eslint-plugin-prettier": "^5.1.3",
7171
"json-loader": "^0.5.7",
7272
"katex": "^0.16.9",
7373
"less": "^4.1.1",

src/components/MarkdownForKatex.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const MarkdownForKatex: React.FC<MarkdownProps> = ({ className, text }) =
3030
React.useEffect(() => {
3131
if (typeof window !== 'undefined') {
3232
// for SSR
33-
(async () => {
33+
void (async () => {
3434
const rehypeKatex = (await import('rehype-katex')) as any;
3535
setRehypePlugins([[rehypeKatex.default, katexOptions], rehypeRaw]);
3636
})();

src/components/MarkdownForMathjax.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export const MarkdownForMathjax: React.FC<MarkdownProps> = ({ className, text })
3030
React.useEffect(() => {
3131
if (typeof window !== 'undefined') {
3232
// for SSR
33-
(async () => {
34-
// @ts-expect-error
33+
void (async () => {
34+
// @ts-expect-error rehype-mathjax is not typed
3535
const rehypeMathjax = await import('rehype-mathjax');
3636
setRehypePlugins([[rehypeMathjax.default, mathjaxOptions], rehypeRaw]);
3737
})();

src/markdown.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const remarkLatexEnvironment: () => Transformer = () => {
3030
});
3131
});
3232
} finally {
33+
// eslint-disable-next-line no-unsafe-finally
3334
return tree;
3435
}
3536
};

0 commit comments

Comments
 (0)