-
-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add website lint rules and tests
- Loading branch information
1 parent
ce01c6f
commit f5ce8cc
Showing
31 changed files
with
3,366 additions
and
875 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
website/ | ||
website/build | ||
website/.docusaurus | ||
website/.cache-loader | ||
website/**/*.mdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'GitHub Pages' | ||
on: | ||
pull_request: | ||
paths: | ||
- 'website/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Actions - Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Actions - Setup NodeJS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: npm- | ||
|
||
- name: Installing Dependencies | ||
run: cd website && npm ci | ||
|
||
- name: Lint Checking | ||
run: cd website && npm run lintcheck | ||
|
||
- name: Checking Types | ||
run: cd website && npm run typecheck | ||
|
||
- name: Checking Build | ||
run: cd website && npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/build | ||
/.docusaurus | ||
/.cache-loader | ||
/**/*.mdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint", "import", "react", "react-hooks"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
"plugin:react-hooks/recommended", | ||
"plugin:react/jsx-runtime" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"rules": { | ||
"import/no-cycle": ["error", { "maxDepth": "∞" }], | ||
"import/no-unresolved": ["error", { "ignore": ["^@docusaurus/"] }], | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"selector": "ImportDeclaration[source.value=/^\\./][source.value!=/\\.(js(on(c)?)?|(s)?css|svg|ico)$/]", | ||
"message": "Local imports must have the explicit extension" | ||
} | ||
], | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 120, | ||
"ignoreComments": true, | ||
"ignoreTrailingComments": true, | ||
"ignoreUrls": true, | ||
"ignoreStrings": true, | ||
"ignoreTemplateLiterals": true, | ||
"ignoreRegExpLiterals": true | ||
} | ||
], | ||
"eol-last": ["error", "always"], | ||
"eqeqeq": [2, "always"], | ||
"no-var": 2, | ||
"block-scoped-var": 2, | ||
"no-async-promise-executor": 2, | ||
"no-bitwise": [2, { "allow": ["~"] }], | ||
"no-duplicate-imports": [2, { "includeExports": true }], | ||
"no-eq-null": 2, | ||
"no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 0 }], | ||
"no-template-curly-in-string": 2, | ||
"no-unneeded-ternary": 2, | ||
"quote-props": [2, "as-needed"], | ||
"require-await": 2, | ||
"rest-spread-spacing": [2, "never"], | ||
"semi-spacing": 2, | ||
"space-before-function-paren": [ | ||
2, | ||
{ "anonymous": "always", "named": "never", "asyncArrow": "always" } | ||
], | ||
"space-unary-ops": 2, | ||
"yoda": 2, | ||
"no-const-assign": 2, | ||
"no-extra-semi": 2, | ||
"for-direction": 2, | ||
"no-eval": 2, | ||
"indent": ["error", 2, { "offsetTernaryExpressions": true }], | ||
"no-empty": ["error", { "allowEmptyCatch": true }] | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": { | ||
"@typescript-eslint/semi": ["error", "always"], | ||
"@typescript-eslint/quotes": [ | ||
"error", | ||
"single", | ||
{ "avoidEscape": true, "allowTemplateLiterals": true } | ||
], | ||
"@typescript-eslint/no-empty-function": [ | ||
"error", | ||
{ "allow": ["arrowFunctions"] } | ||
], | ||
"@typescript-eslint/indent": [ | ||
"error", | ||
2, | ||
{ "offsetTernaryExpressions": true } | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.js"], | ||
"parserOptions": { | ||
"project": null | ||
}, | ||
"rules": { | ||
"semi": ["error", "always"], | ||
"quotes": [ | ||
"error", | ||
"single", | ||
{ "avoidEscape": true, "allowTemplateLiterals": true } | ||
], | ||
"no-unused-vars": 2 | ||
} | ||
} | ||
], | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": { | ||
"alwaysTryTypes": true, | ||
"extensions": [".js", ".ts", "*.jsx", ".tsx"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/build | ||
/.docusaurus | ||
/.cache-loader | ||
# /**/*.mdx | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"quoteProps": "as-needed", | ||
"jsxSingleQuote": true, | ||
"trailingComma": "es5", | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"arrowParens": "always", | ||
"proseWrap": "preserve", | ||
"htmlWhitespaceSensitivity": "css", | ||
"endOfLine": "auto", | ||
"embeddedLanguageFormatting": "auto", | ||
"singleAttributePerLine": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.