Skip to content

Commit

Permalink
chore: files
Browse files Browse the repository at this point in the history
  • Loading branch information
guanbinrui committed Mar 5, 2024
1 parent 827f559 commit 16e8668
Show file tree
Hide file tree
Showing 92 changed files with 12,832 additions and 7,473 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 4
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
next.config.js
lingui.config.js
postcss.config.cjs
tailwind.config.cjs

src/locales/**/*.js
public/js
179 changes: 178 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,180 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"plugins": [
"no-relative-import-paths",
"eslint-plugin-simple-import-sort",
"@typescript-eslint/eslint-plugin",
"eslint-plugin-react",
"eslint-plugin-react-hooks",
"eslint-plugin-unicorn",
"eslint-plugin-import",
"unused-imports"
],
"rules": {
"default-case-last": "error",
"eqeqeq": "error",
"import/no-empty-named-blocks": "warn",
"import/no-named-default": "warn",
"import/no-useless-path-segments": "warn",
"import/no-webpack-loader-syntax": "error",
"no-bitwise": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "warn",
"no-constructor-return": "error",
"no-control-regex": "error",
"no-debugger": "warn",
"no-div-regex": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "warn",
"no-ex-assign": "warn",
"no-extra-bind": "warn",
"no-extra-boolean-cast": "warn",
"no-extra-label": "warn",
"no-global-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "warn",
"no-label-var": "error",
"no-misleading-character-class": "error",
"no-new-wrappers": "error",
"no-plusplus": "error",
"no-regex-spaces": "error",
"no-restricted-globals": ["error", "event", "name", "length", "closed"],
"no-restricted-imports": [
"error",
{
"patterns": ["src/maskbook/*", "@/maskbook/*"]
}
],
"no-script-url": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "warn",
"no-unreachable-loop": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "warn",
"no-unused-vars": "off",
"no-useless-backreference": "error",
"no-useless-call": "warn",
"no-useless-catch": "warn",
"no-useless-concat": "warn",
"no-useless-escape": "warn",
"object-shorthand": "warn",
"prefer-const": "warn",
"prefer-numeric-literals": "warn",
"prefer-object-has-own": "warn",
"prefer-regex-literals": "warn",
"radix": "warn",
"spaced-comment": ["warn", "always", { "line": { "markers": ["/"] } }],
"unused-imports/no-unused-imports": "error",
"valid-typeof": "error",
"yoda": "warn",
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-leaked-render": "error",
"react/jsx-no-script-url": "error",
"react/no-danger": "error",
"react/no-danger-with-children": "error",
"react/no-namespace": "error",
"react/no-unstable-nested-components": "error",
"react/void-dom-elements-no-children": "error",
"react/no-invalid-html-attribute": "warn",
"react/jsx-key": [
"warn",
{ "checkFragmentShorthand": true, "checkKeyMustBeforeSpread": true, "warnOnDuplicates": true }
],
"react/jsx-no-constructed-context-values": "warn",
"react/no-deprecated": "error",
"react/no-find-dom-node": "error",
"react/function-component-definition": [
"warn",
{
"namedComponents": "function-declaration",
"unnamedComponents": ["function-expression", "arrow-function"]
}
],
"react/jsx-boolean-value": ["error", "never"],
"react/self-closing-comp": ["error", { "component": true, "html": true }],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"{}": false,
"FC": {
"message": "To declare a component, you don't have to use FC to annotate it. To type something that accepts/is a React Component, use ComponentType<T>.",
"fixWith": "ComponentType"
},
"ReactElement": {
"message": "In most cases, you want ReactNode. Only ignore this rule when you want to use cloneElement.",
"fixWith": "ReactNode"
},
"React.FC": {
"message": "To declare a component, you don't have to use React.FC to annotate it. To type something that accepts/is a React Component, use React.ComponentType<T>.",
"fixWith": "React.ComponentType"
},
"React.ReactElement": {
"message": "In most cases, you want React.ReactNode. Only ignore this rule when you want to use cloneElement.",
"fixWith": "React.ReactNode"
}
},
"extendDefaults": true
}
],
"@typescript-eslint/array-type": ["warn", { "default": "array-simple" }],
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/consistent-type-assertions": ["warn", { "assertionStyle": "as" }],
"@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-extra-non-null-assertion": "warn",
"@typescript-eslint/no-for-in-array": "warn",
"@typescript-eslint/no-implied-eval": "error",
"@typescript-eslint/no-loop-func": "warn",
"@typescript-eslint/no-loss-of-precision": "error",
"@typescript-eslint/no-meaningless-void-operator": "warn",
"@typescript-eslint/no-mixed-enums": "error",
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"@typescript-eslint/prefer-as-const": "warn",
"@typescript-eslint/prefer-enum-initializers": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/prefer-return-this-type": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/no-misused-new": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{
"prefix": "@",
"rootDir": "src"
}
]
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"project": "./tsconfig.eslint.json",
"warnOnUnsupportedTypeScriptVersion": false,
"allowAutomaticSingleRunInference": true
}
}
3 changes: 0 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
with:
node-version: '18.9.0'

- name: Setup Github Actions
run: ./scripts/setup-gh-actions.sh

- name: Compile typescript files
run: npx tsc -p tsconfig.json --noEmit false

Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
23 changes: 23 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ignore entire directories
node_modules/
dist/
build/

.next/
.github/

# Ignore specific files
*.min.js
*.min.css

# Ignore locales
*.po

# Ignore all files of a specific type in a specific directory
public/*.html

# Ignore files based on wildcard patterns
**/vendor/**/*.js

# Ignore git submodule
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-opti

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

Expand Down
6 changes: 2 additions & 4 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const config = {
catalogs: [
{
path: 'src/locales/{locale}/messages',
include: [
'src/app/**',
],
include: ['src/app/**'],
},
],
fallbackLocales: {
Expand All @@ -28,4 +26,4 @@ const config = {
format: formatter({ origins: false }),
};

export default config;
export default config;
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const config = {
},
];
},

};

export default config;
export default config;
Loading

0 comments on commit 16e8668

Please sign in to comment.