加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.eslintrc.js 2.69 KB
一键复制 编辑 原始数据 按行查看 历史
Guillaume Chau 提交于 2022-03-14 17:52 . fix: hook import not working
module.exports = {
root: true,
env: {
browser: true,
},
extends: [
'plugin:vue/recommended',
'@vue/standard',
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
},
globals: {
bridge: true,
chrome: true,
localStorage: 'off',
HTMLDocument: true,
name: 'off',
browser: true,
},
rules: {
'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'always',
},
],
'no-var': ['error'],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none',
},
singleline: {
delimiter: 'comma',
},
},
],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
camelcase: 'warn',
'no-prototype-builtins': 'off',
'no-use-before-define': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'comma-dangle': ['error', 'always-multiline'],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
},
ignorePatterns: [
'node_modules/',
'/packages/*/lib/',
'dist/',
'build/',
'build-node/',
'/legacy',
],
overrides: [
{
files: [
'release.js',
'sign-firefox.js',
'extension-zips.js',
'packages/build-tools/**',
'packages/shell-electron/**',
'**webpack.config.js',
],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/camelcase': 'off',
},
},
{
files: ['packages/shell-dev-vue3/**'],
rules: {
'vue/valid-template-root': 'off',
},
},
{
files: [
'packages/shell-dev-vue2/**',
'packages/shell-dev-vue3/**',
],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'vue/require-default-prop': 'off',
'vue/require-prop-types': 'off',
'no-console': 'off',
},
},
{
files: [
'packages/shell-host/**',
],
globals: {
localStorage: false,
},
rules: {
'no-console': 'off',
},
},
{
files: [
'packages/app-backend-core/src/hook.ts',
],
rules: {
'no-restricted-syntax': ['error', {
selector: 'ImportDeclaration',
message: 'File is injected with a `Function.toString()`, imports will not work',
}, {
selector: `CallExpression[callee.name='require']`,
message: 'File is injected with a `Function.toString()`, require will not work',
}],
},
},
],
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化