1 Star 4 Fork 1

OpenKG/Richpedia

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.eslintrc.js 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
zjx 提交于 2021-01-28 18:09 . the first time
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
// ESLint configuration
// http://eslint.org/docs/user-guide/configuring
module.exports = {
parser: 'babel-eslint',
extends: [
'airbnb',
'plugin:flowtype/recommended',
'plugin:css-modules/recommended',
'prettier',
'prettier/flowtype',
'prettier/react',
],
plugins: ['flowtype', 'css-modules', 'prettier', 'jest'],
globals: {
__DEV__: true,
},
env: {
browser: true,
jest: true,
},
rules: {
// Forbid the use of extraneous packages
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
// https://eslint.org/docs/rules/no-console
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
},
],
// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: false,
object: false,
},
},
{
enforceForRenamedProperties: false,
},
],
// Ensure <a> tags are valid
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
aspects: ['noHref', 'invalidHref', 'preferButton'],
},
],
// Allow .js files to use JSX syntax
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
// Functional and class components are equivalent from React’s point of view
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
'react/prefer-stateless-function': 'off',
// ESLint plugin for prettier formatting
// https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': 'error',
'react/forbid-prop-types': 'off',
'react/destructuring-assignment': 'off',
},
settings: {
// Allow absolute paths in imports, e.g. import Button from 'components/Button'
// https://github.com/benmosher/eslint-plugin-import/tree/master/resolvers
'import/resolver': {
node: {
moduleDirectory: ['node_modules', 'src'],
},
},
},
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/openkg/richpedia.git
git@gitee.com:openkg/richpedia.git
openkg
richpedia
Richpedia
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385