From 1b16cb9ac6ed44038986c2a0dc1c8d5baa73964c Mon Sep 17 00:00:00 2001 From: pqcqaq <905739777@qq.com> Date: Tue, 16 Jul 2024 17:50:25 +0800 Subject: [PATCH] lint --- .editorconfig | 14 +++++++++++ .eslintignore | 3 +++ .eslintrc | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ .npmrc | 1 + 4 files changed, 87 insertions(+) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .npmrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aca2523 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..607e9cc --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +node_modules/ +packages/react-live/dist/ +website/build/ diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..703c3a5 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,69 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": ["prettier", "@typescript-eslint"], + "settings": { + "react": { + "version": "detect" + } + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react/recommended", + "plugin:import/recommended", + "plugin:import/typescript" + ], + "env": { + "browser": true, + "commonjs": true, + "es6": true, + "node": true, + "jest": true + }, + "globals": { + "expect": true + }, + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "generators": true, + "experimentalObjectRestSpread": true + }, + "requireConfigFile": false + }, + "rules": { + "comma-dangle": "off", + "indent": "off", + "space-before-function-paren": "off", + "react/jsx-indent-props": "off", + "max-len": "off", + "no-magic-numbers": "off", + "func-style": "off", + "arrow-parens": "off", + "no-use-before-define": "off", + "no-undef": "off", + "react/jsx-filename-extension": "off", + "react/require-extension": "off", + "react/no-multi-comp": "off", + "react/prop-types": "warn", + "react/sort-comp": "warn", + "react/sort-prop-types": "warn", + "react/jsx-handler-names": "off", + "react/no-find-dom-node": "off", + "no-invalid-this": "off", + "complexity": "off", + "no-unused-vars": 0, + "import/no-unresolved": [2, { "ignore": ["polished", "next/document"] }], + "prefer-template": "off", + "filenames/match-regex": "off", + "react/react-in-jsx-scope": "off", + "max-params": ["error", 5], + "max-nested-callbacks": ["error", 5], + "prettier/prettier": "error", + "@typescript-eslint/no-unused-vars": ["error"], + "@typescript-eslint/no-var-requires": 0 + } +} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..f301fed --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +auto-install-peers=false