Skip to content

Commit 1a1b359

Browse files
committed
chore: upgrade deps; reformat
1 parent a4c1176 commit 1a1b359

File tree

34 files changed

+1107
-997
lines changed

34 files changed

+1107
-997
lines changed

.eslintrc.js

Lines changed: 13 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,29 @@
11
module.exports = {
22
root: true,
3-
env: {
4-
es6: true,
5-
},
6-
extends: [
7-
'airbnb',
8-
'plugin:react/recommended',
9-
'plugin:@typescript-eslint/recommended',
10-
'plugin:eslint-comments/recommended',
11-
'prettier',
12-
],
13-
globals: {
14-
Atomics: 'readonly',
15-
SharedArrayBuffer: 'readonly',
16-
},
17-
parser: '@typescript-eslint/parser',
18-
parserOptions: {
19-
ecmaFeatures: {
20-
jsx: true,
3+
settings: {
4+
"import/resolver": {
5+
// resolves the .tsx / .ts imports
6+
node: {
7+
extensions: [".js", ".json", ".mjs", ".ts", ".tsx"],
8+
},
219
},
22-
ecmaVersion: 2018,
23-
sourceType: 'module',
2410
},
25-
plugins: [
26-
'react',
27-
'react-hooks',
28-
'@typescript-eslint',
29-
'eslint-comments',
30-
'prettier',
31-
],
11+
extends: ["jc"],
3212
rules: {
33-
// Allow JSX appearance in files with these extensions
34-
'react/jsx-filename-extension': [
35-
'error',
36-
{
37-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
38-
},
39-
],
40-
'no-use-before-define': 'off',
41-
'import/no-unresolved': [
42-
'error',
13+
"import/no-unresolved": [
14+
"error",
4315
{
4416
// built-in imports in Docusaurus v2
45-
ignore: ['^@theme', '^@docusaurus', '^@site'],
17+
ignore: ["^@theme", "^@docusaurus", "^@site"],
4618
},
4719
],
48-
'import/no-duplicates': 'off',
49-
// These are deemed unnecessary
50-
'react/jsx-one-expression-per-line': 'off',
51-
'import/extensions': 'off',
52-
'react/jsx-closing-bracket-location': [
53-
'error',
54-
{ nonEmpty: 'after-props', selfClosing: 'line-aligned' },
55-
],
56-
'react/jsx-props-no-spreading': 'off',
57-
'@typescript-eslint/no-non-null-assertion': 'off',
58-
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
59-
'react/function-component-definition': [
60-
'warn',
61-
{
62-
namedComponents: 'function-declaration',
63-
unnamedComponents: 'arrow-function',
64-
},
65-
],
66-
},
67-
settings: {
68-
'import/resolver': {
69-
// resolves the .tsx / .ts imports
70-
node: {
71-
extensions: ['.js', '.json', '.mjs', '.ts', '.tsx'],
72-
},
73-
},
7420
},
7521
overrides: [
7622
{
77-
// JS files should not be treated as TypeScript
78-
// See https://github.com/typescript-eslint/typescript-eslint/issues/109
79-
files: ['*.js', '*.jsx'],
23+
files: ["*.d.ts"],
8024
rules: {
81-
'@typescript-eslint/explicit-function-return-type': 'off',
82-
'@typescript-eslint/explicit-module-boundary-types': 'off',
83-
'@typescript-eslint/no-var-requires': 'off',
84-
// may need to add more rules
25+
"@typescript-eslint/no-duplicate-imports": "off",
26+
"import/no-duplicates": "off",
8527
},
8628
},
8729
],

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.{js,jsx,ts,tsx,mjs}": ["eslint --fix"],
3+
"*": ["prettier --ignore-unknown --write"]
4+
}

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
"useTabs": false,
55
"trailingComma": "all",
66
"semi": true,
7-
"singleQuote": true,
87
"bracketSameLine": true
98
}

.yarn/sdks/eslint/bin/eslint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { existsSync } = require(`fs`);
44
const { createRequire, createRequireFromPath } = require(`module`);
55
const { resolve } = require(`path`);
66

7-
const relPnpApiPath = '../../../../.pnp.cjs';
7+
const relPnpApiPath = "../../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
1010
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

.yarn/sdks/eslint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint",
3-
"version": "8.4.1-sdk",
3+
"version": "8.9.0-sdk",
44
"main": "./lib/api.js",
55
"type": "commonjs"
66
}

.yarn/sdks/prettier/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { existsSync } = require(`fs`);
44
const { createRequire, createRequireFromPath } = require(`module`);
55
const { resolve } = require(`path`);
66

7-
const relPnpApiPath = '../../../.pnp.cjs';
7+
const relPnpApiPath = "../../../.pnp.cjs";
88

99
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
1010
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

.yarn/sdks/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript",
3-
"version": "4.5.4-sdk",
3+
"version": "4.5.5-sdk",
44
"main": "./lib/typescript.js",
55
"type": "commonjs"
66
}

docusaurus.config.js

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
1-
const remarkMath = require('remark-math');
2-
const rehypeKatex = require('rehype-katex');
3-
const githubTheme = require('prism-react-renderer/themes/github');
4-
const draculaTheme = require('prism-react-renderer/themes/dracula');
1+
const remarkMath = require("remark-math");
2+
const rehypeKatex = require("rehype-katex");
3+
const githubTheme = require("prism-react-renderer/themes/github");
4+
const draculaTheme = require("prism-react-renderer/themes/dracula");
55

66
module.exports = {
7-
title: 'Computerization',
8-
tagline: 'C社 << Computerization << 世外信息化社',
9-
url: 'https://computerization.io',
10-
baseUrl: '/',
11-
favicon: 'img/favicon/favicon.ico',
7+
title: "Computerization",
8+
tagline: "C社 << Computerization << 世外信息化社",
9+
url: "https://computerization.io",
10+
baseUrl: "/",
11+
favicon: "img/favicon/favicon.ico",
1212
trailingSlash: true,
1313
i18n: {
14-
defaultLocale: 'zh-Hans',
15-
locales: ['zh-Hans', 'en'],
14+
defaultLocale: "zh-Hans",
15+
locales: ["zh-Hans", "en"],
1616
localeConfigs: {
17-
'zh-Hans': {
18-
label: '中文(简体)',
17+
"zh-Hans": {
18+
label: "中文(简体)",
1919
},
2020
en: {
21-
label: 'English',
21+
label: "English",
2222
},
2323
},
2424
},
25-
plugins: ['alumni'],
25+
plugins: ["alumni"],
2626
themeConfig: {
2727
navbar: {
28-
title: '世外信息化社',
28+
title: "世外信息化社",
2929
logo: {
30-
alt: 'Computerization Logo',
31-
src: 'img/logo.svg',
32-
srcDark: 'img/logo.svg',
30+
alt: "Computerization Logo",
31+
src: "img/logo.svg",
32+
srcDark: "img/logo.svg",
3333
},
3434
items: [
35-
{ to: 'alumni', label: '往届成员', position: 'left' },
36-
{ to: 'docs/about-us', label: '文档', position: 'left' },
37-
{ to: 'blog', label: '博客', position: 'left' },
35+
{ to: "alumni", label: "往届成员", position: "left" },
36+
{ to: "docs/about-us", label: "文档", position: "left" },
37+
{ to: "blog", label: "博客", position: "left" },
3838
{
39-
type: 'localeDropdown',
40-
position: 'right',
39+
type: "localeDropdown",
40+
position: "right",
4141
},
4242
{
43-
href: 'https://github.com/Computerization',
44-
label: 'GitHub',
45-
position: 'right',
43+
href: "https://github.com/Computerization",
44+
label: "GitHub",
45+
position: "right",
4646
},
4747
],
4848
},
4949
footer: {
50-
style: 'dark',
50+
style: "dark",
5151
links: [
5252
{
53-
title: '文档',
53+
title: "文档",
5454
items: [
5555
{
56-
label: '文档',
57-
to: 'docs/about-us',
56+
label: "文档",
57+
to: "docs/about-us",
5858
},
5959
],
6060
},
6161
{
62-
title: '社区',
62+
title: "社区",
6363
items: [
6464
{
65-
label: 'GitHub',
66-
href: 'https://github.com/Computerization',
65+
label: "GitHub",
66+
href: "https://github.com/Computerization",
6767
},
6868
],
6969
},
7070
{
71-
title: '社交',
71+
title: "社交",
7272
items: [
7373
{
74-
label: '博客',
75-
to: 'blog',
74+
label: "博客",
75+
to: "blog",
7676
},
7777
],
7878
},
7979
],
8080
logo: {
81-
alt: 'Computerization Logo',
82-
src: 'img/logo.svg',
81+
alt: "Computerization Logo",
82+
src: "img/logo.svg",
8383
},
8484
copyright: `世外信息化社 © ${new Date().getFullYear()} 版权所有. 使用 Docusaurus 搭建.`,
8585
},
@@ -90,28 +90,28 @@ module.exports = {
9090
},
9191
stylesheets: [
9292
{
93-
href: 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css',
94-
type: 'text/css',
93+
href: "https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css",
94+
type: "text/css",
9595
integrity:
96-
'sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X',
97-
crossorigin: 'anonymous',
96+
"sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X",
97+
crossorigin: "anonymous",
9898
},
9999
],
100100
scripts: [
101101
{
102-
src: 'https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js',
102+
src: "https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js",
103103
integrity:
104-
'sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4',
105-
crossorigin: 'anonymous',
104+
"sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4",
105+
crossorigin: "anonymous",
106106
defer: true,
107107
},
108108
],
109109
presets: [
110110
[
111-
'classic',
111+
"classic",
112112
{
113113
docs: {
114-
sidebarPath: require.resolve('./sidebars.js'),
114+
sidebarPath: require.resolve("./sidebars.js"),
115115
remarkPlugins: [remarkMath],
116116
rehypePlugins: [[rehypeKatex, { strict: false }]],
117117
},
@@ -120,7 +120,7 @@ module.exports = {
120120
rehypePlugins: [[rehypeKatex, { strict: false }]],
121121
},
122122
theme: {
123-
customCss: require.resolve('./src/css/custom.css'),
123+
customCss: require.resolve("./src/css/custom.css"),
124124
},
125125
},
126126
],

package.json

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
"write-heading-ids": "docusaurus write-heading-ids",
1616
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,html,css}\"",
1717
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,html,css}\"",
18-
"lint": "eslint . --ext=js,jsx,ts,tsx",
19-
"lint:fix": "yarn lint --fix",
18+
"lint": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"",
2019
"prepare": "husky install"
2120
},
2221
"dependencies": {
23-
"@docusaurus/core": "2.0.0-beta.14",
24-
"@docusaurus/preset-classic": "2.0.0-beta.14",
25-
"@docusaurus/theme-classic": "2.0.0-beta.14",
22+
"@docusaurus/core": "2.0.0-beta.15",
23+
"@docusaurus/preset-classic": "2.0.0-beta.15",
24+
"@docusaurus/theme-classic": "2.0.0-beta.15",
2625
"@mdx-js/react": "1.6.22",
2726
"clsx": "1.1.1",
2827
"docusaurus-plugin-alumni": "0.0.0",
@@ -45,36 +44,24 @@
4544
]
4645
},
4746
"devDependencies": {
48-
"@docusaurus/module-type-aliases": "2.0.0-beta.14",
49-
"@docusaurus/types": "2.0.0-beta.14",
47+
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
48+
"@docusaurus/types": "2.0.0-beta.15",
5049
"@tsconfig/docusaurus": "1.0.4",
51-
"@types/node": "16.11.7",
52-
"@typescript-eslint/eslint-plugin": "5.9.0",
53-
"@typescript-eslint/parser": "5.9.0",
54-
"eslint": "8.4.1",
55-
"eslint-config-airbnb": "19.0.2",
56-
"eslint-config-prettier": "8.3.0",
50+
"@types/node": "17.0.19",
51+
"@typescript-eslint/eslint-plugin": "5.12.1",
52+
"@typescript-eslint/parser": "5.12.1",
53+
"eslint": "8.9.0",
54+
"eslint-config-jc": "2.1.1",
5755
"eslint-import-resolver-node": "0.3.6",
58-
"eslint-plugin-eslint-comments": "3.2.0",
59-
"eslint-plugin-import": "2.25.3",
56+
"eslint-plugin-import": "2.25.4",
6057
"eslint-plugin-jsx-a11y": "6.5.1",
61-
"eslint-plugin-prettier": "4.0.0",
62-
"eslint-plugin-react": "7.27.1",
58+
"eslint-plugin-react": "7.28.0",
6359
"eslint-plugin-react-hooks": "4.3.0",
64-
"husky": "7.0.2",
65-
"lint-staged": "11.2.3",
60+
"husky": "7.0.4",
61+
"lint-staged": "12.3.4",
6662
"prettier": "2.5.1",
67-
"typescript": "4.5.4",
63+
"typescript": "4.5.5",
6864
"unified": "9.2.1"
6965
},
70-
"lint-staged": {
71-
"*.{js,jsx,ts,tsx}": [
72-
"eslint --cache --fix",
73-
"prettier --write"
74-
],
75-
"*.{md,mdx,html,css}": [
76-
"prettier --write"
77-
]
78-
},
7966
"packageManager": "yarn@3.1.1"
8067
}

0 commit comments

Comments
 (0)