Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Jul 12, 2020
0 parents commit 2124a7d
Show file tree
Hide file tree
Showing 14 changed files with 4,618 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build
/config
dist
node_modules
/*.js
84 changes: 84 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
module.exports = {
env: {
browser: true,
es6: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', 'tsx'],
},
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'react-hooks'],
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
rules: {
'no-console':
process.env.NODE_ENV === 'production' ? ['error', { allow: ['warn', 'error'] }] : 'off',
// 对象声明都必须用解构: 关闭
'prefer-destructuring': 0,
// 禁止for of: 关闭
'no-restricted-syntax': 0,
// 禁止++ 主要是不加分号可能语法混乱, 这里都加分号直接关闭.
'no-plusplus': 0,

'no-unused-expressions': [2, { allowShortCircuit: true, allowTernary: true }],
// 重新分配函数参数 forEach immer 中很多问题, 使用typescript readonly
'no-param-reassign': 0,
'class-methods-use-this': 0,

'react/self-closing-comp': [
'error',
{
component: true,
html: false,
},
],

'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
'react/jsx-no-target-blank': 0,
'react/destructuring-assignment': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-props-no-spreading': 0,

// 每个函数需要明确的返回的type: 关闭
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,

'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/array-type': [2, { default: 'array' }],
'@typescript-eslint/explicit-member-accessibility': 0,

'import/no-extraneous-dependencies': 0,
'import/prefer-default-export': 0,
'import/extensions': [
'error',
'ignorePackages',
{
ts: 'never',
tsx: 'never',
js: 'never',
jsx: 'never',
},
],
},
};
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.cache
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
CHANGELOG.md
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"printWidth": 100,
"arrowParens": "always"
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# react-modal-store

To manage global modal like route.
16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
plugins: [],
};
};
Loading

0 comments on commit 2124a7d

Please sign in to comment.