1 Star 0 Fork 88

Tony2012/Hippy

forked from 腾讯开源/Hippy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.eslintrc.js 3.11 KB
一键复制 编辑 原始数据 按行查看 历史
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'airbnb',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
plugins: [
'@typescript-eslint',
],
env: {
browser: true,
node: true,
},
globals: {
__PLATFORM__: true,
__GLOBAL__: true,
Hippy: true,
},
rules: {
// Ignore the dependency by each package
'import/no-unresolved': 'off',
// Allow comment or require align with space
'no-multi-spaces': 'off',
// Allow import name different with file name
'import/no-named-as-default': 'off',
// Allow imoprt cycle
'import/no-cycle': 'off',
// Disable prop-types
'react/prop-types': 'off',
// Turn of extensions checking temporary
'import/extensions': 'off',
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules/namespace.md#allowcomputed
'import/namespace': [
'error',
{
allowComputed: true,
},
],
// Allow import from devDependencies
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'scripts/*.js',
'packages/**/types/*.d.ts', // FIXME: seems not working
'packages/**/__tests__/*.test.js',
'examples/**/scripts/*.js',
],
},
],
// Allow tsx as the jsx file
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx', '.jsx'],
},
],
// Allow global underscore in dangle
'no-underscore-dangle': [
'error',
{
allow: [
'__ISHIPPY__',
'__GLOBAL__',
'__HIPPYNATIVEGLOBAL__',
'__instanceId__',
'_reactInternalFiber',
],
},
],
},
settings: {
'import/resolver': {
alias: {
map: [
['vue', 'vue/src/core/index'],
['compiler', 'vue/src/compiler'],
['web', 'vue/src/platforms/web'],
['core', 'vue/src/core'],
['shared', 'vue/src/shared'],
['sfc', 'vue/src/sfc'],
['he', './packages/hippy-vue/util/entity-decoder'],
['@localTypes', './types'],
['@vue', './packages/hippy-vue/src'],
['@router', './packages/hippy-vue-router/src'],
['@css-loader', './packages/hippy-vue-css-loader/src'],
['@native-components', './packages/hippy-vue-native-components/src'],
],
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
},
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
// Allow interface export
'no-undef': 'off',
// Disable props checking
'react/prop-types': 'off',
// Force use 2 space for indent
'@typescript-eslint/indent': ['error', 2],
// Note you must disable the base rule as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
},
],
},
},
],
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/lfnian/Hippy.git
git@gitee.com:lfnian/Hippy.git
lfnian
Hippy
Hippy
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385