Skip to content

Commit 47cf27f

Browse files
committed
setup linting
1 parent 260f7c5 commit 47cf27f

File tree

5 files changed

+462
-16
lines changed

5 files changed

+462
-16
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ignore configs
2+
.eslintrc.js
3+
babel.config.js
4+
docusaurus.config.js
5+
6+
# ignore built directories
7+
node_modules
8+
build
9+
.docusaurus

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
},
6+
plugins: ["@typescript-eslint", "prettier"],
7+
rules: {
8+
"prettier/prettier": "error",
9+
},
10+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
11+
};

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
1414
"write-heading-ids": "docusaurus write-heading-ids",
15-
"format": "prettier --write ."
15+
"format": "prettier --write .",
16+
"lint": "eslint . --ext .js,.ts,.jsx,.tsx"
1617
},
1718
"dependencies": {
1819
"@docusaurus/core": "^2.0.0-beta.4",
@@ -43,6 +44,11 @@
4344
"@types/react": "^17.0.27",
4445
"@types/react-helmet": "^6.1.3",
4546
"@types/react-router-dom": "^5.3.1",
47+
"@typescript-eslint/eslint-plugin": "^4.33.0",
48+
"@typescript-eslint/parser": "^4.33.0",
49+
"eslint": "^7.32.0",
50+
"eslint-config-prettier": "^8.3.0",
51+
"eslint-plugin-prettier": "^4.0.0",
4652
"prettier": "^2.4.1",
4753
"typescript": "^4.4.3"
4854
}

src/components/HomepageFeatures.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface Feature {
1313
const FeatureList: Feature[] = [
1414
{
1515
title: "Easy to Use",
16+
// eslint-disable-next-line @typescript-eslint/no-var-requires
1617
icon: require("../../static/svg/lightweight.svg").default,
1718
description: (
1819
<>
@@ -30,6 +31,7 @@ const FeatureList: Feature[] = [
3031
},
3132
{
3233
title: "Lightweight Where it Counts",
34+
// eslint-disable-next-line @typescript-eslint/no-var-requires
3335
icon: require("../../static/svg/lightweight.svg").default,
3436
description: (
3537
<>
@@ -40,6 +42,7 @@ const FeatureList: Feature[] = [
4042
},
4143
{
4244
title: "Cross-Platform",
45+
// eslint-disable-next-line @typescript-eslint/no-var-requires
4346
icon: require("../../static/svg/win-mac-lin-combo-interesting.svg").default,
4447
description: (
4548
<>

0 commit comments

Comments
 (0)