diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..fd657ce --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,2 @@ +> 0.25% +not ie < 11 diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..97d31ce --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +kind: pipeline +type: docker +name: compile project + +steps: +- name: npm + image: plugins/npm + settings: + username: + from_secret: NPM_USERNAME + password: + from_secret: NPM_PASSWORD + email: + from_secret: NPM_EMAIL + commands: + - npm i -g pnpm + - pnpm i + - pnpm build + - tar czf yacd.tar.gz ./public + +- name: gitea_release + image: plugins/gitea-release + settings: + api_key: + from_secret: gitea_api_key + base_url: https://git.liyp.cc + files: yacd.tar.gz + when: + event: tag + tag: v* + diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..ac0f16d --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,45 @@ +parser: '@typescript-eslint/parser' + +plugins: + - simple-import-sort + - jsx-a11y + +extends: + - 'plugin:@typescript-eslint/recommended' + - prettier + - react-app + - 'plugin:jsx-a11y/recommended' + +env: + node: true + jest: true + +globals: + __DEV__: true + +rules: + '@typescript-eslint/no-empty-interface': 'off' + '@typescript-eslint/interface-name-prefix': 'off' + '@typescript-eslint/explicit-function-return-type': 'off' + '@typescript-eslint/no-explicit-any': 'off' + '@typescript-eslint/camelcase': 'off' + 'no-use-before-define': 'off' + '@typescript-eslint/no-unused-vars': + - 'error' + - argsIgnorePattern: '^_' + '@typescript-eslint/no-use-before-define': + - 'error' + - functions: false + # disable this temporarily since we have a lot of JS files + # and typescript-eslint runs against JS files too + '@typescript-eslint/explicit-module-boundary-types': 'off' + '@typescript-eslint/ban-ts-comment': 'off' + '@typescript-eslint/ban-ts-ignore': 'off' + react-hooks/rules-of-hooks: 'error' + react-hooks/exhaustive-deps: + - 'warn' + - additionalHooks: 'useRecoilCallback' + simple-import-sort/imports: 'error' +# quotes: ['error', 'single'] +# strict: ['error', 'never'] +# no-console: 'warn' diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..1356c66 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "*.{js,jsx,ts,tsx,md,html,css,less,scss,json,yml,yaml}": "prettier --write", + "*.{js,jsx,ts,tsx}": "eslint --fix" +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..5ac85e2 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "printWidth": 100, + "singleQuote": true +}