1 Star 0 Fork 3

囧囧 / svgedit

forked from 徐旭 / svgedit 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.eslintrc.js 5.41 KB
一键复制 编辑 原始数据 按行查看 历史
module.exports = {
extends: [
"ash-nazg/sauron-node",
"plugin:qunit/recommended", "plugin:testcafe/recommended"
],
parserOptions: {
sourceType: "module"
},
// Need to make explicit here for processing by jsdoc/check-examples
plugins: ["qunit"],
env: {
browser: true
},
settings: {
polyfills: [
"Array.isArray",
"Blob",
"console",
"Date.now",
"document.body",
"document.evaluate",
"document.head",
"document.importNode",
"document.querySelector", "document.querySelectorAll",
"DOMParser",
"Error",
"fetch",
"FileReader",
"history.pushState",
"history.replaceState",
"JSON",
"location.href",
"location.origin",
"MutationObserver",
"Object.assign", "Object.defineProperty", "Object.defineProperties",
"Object.getOwnPropertyDescriptor",
"Object.entries", "Object.keys", "Object.values",
"Promise",
"Set",
"Uint8Array",
"URL",
"window.getComputedStyle",
"window.postMessage",
"window.scrollX", "window.scrollY",
"XMLHttpRequest",
"XMLSerializer"
],
jsdoc: {
additionalTagNames: {
// In case we need to extend
customTags: []
},
augmentsExtendsReplacesDocs: true,
// Todo: Figure out why this is not working and why seem to have to
// disable for all Markdown:
/*
baseConfig: {
rules: {
"no-multi-spaces": "off"
}
}
*/
}
},
overrides: [
// Locales have no need for importing outside of SVG-Edit
{
files: [
"editor/locale/lang.*.js", "editor/extensions/ext-locale/**",
"docs/tutorials/ExtensionDocs.md"
],
rules: {
"import/no-anonymous-default-export": ["off"]
}
},
// For extensions, `this` is generally assigned to be the more
// descriptive `svgEditor`; they also have no need for importing outside
// of SVG-Edit
{
files: ["editor/extensions/**/ext-*.js"],
rules: {
"consistent-this": ["error", "svgEditor"],
"import/no-anonymous-default-export": ["off"]
}
},
// These browser files don't do importing or requiring
{
files: [
"editor/svgpathseg.js", "editor/touch.js", "editor/typedefs.js",
"editor/redirect-on-no-module-support.js",
"editor/extensions/imagelib/index.js",
"editor/external/dom-polyfill/dom-polyfill.js",
"test/all_tests.js", "screencasts/svgopen2010/script.js",
"opera-widget/handlers.js",
"firefox-extension/handlers.js",
"firefox-extension/content/svg-edit-overlay.js"
],
rules: {
"import/unambiguous": ["off"]
}
},
{
files: ['test/browser-bugs/**'],
rules: {
'no-var': 'off'
}
},
{
files: ['**/*.html'],
rules: {
'import/unambiguous': 'off'
}
},
// Our Markdown rules (and used for JSDoc examples as well, by way of
// our use of `matchingFileName` in conjunction with
// `jsdoc/check-examples` within `ash-nazg`)
{
files: ["**/*.md"],
rules: {
"eol-last": ["off"],
"no-console": ["off"],
"no-undef": ["off"],
"no-unused-vars": ["warn"],
"padded-blocks": ["off"],
"import/unambiguous": ["off"],
"import/no-unresolved": ["off"],
"node/no-missing-import": ["off"],
"no-multi-spaces": "off",
"sonarjs/no-all-duplicated-branches": "off",
"no-alert": "off",
// Disable until may fix https://github.com/gajus/eslint-plugin-jsdoc/issues/211
"indent": "off"
}
},
// Dis-apply Node rules mistakenly giving errors with browser files,
// and treating Node global `root` as being present for shadowing
{
files: ["editor/**", "test/**", "screencasts/**"],
globals: {
root: "off"
},
rules: {
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": "off"
}
},
// We want console in tests!
{
files: ["test/**"],
rules: {
"no-console": ["off"]
}
},
{
// Node files
files: [
"docs/jsdoc-config.js",
"build-html.js",
"rollup.config.js", "rollup-config.config.js"
],
env: {
node: true,
},
globals: {
require: true
},
rules: {
// We can't put Rollup in npmignore or user can't get access,
// and we have too many modules to add to `peerDependencies`
// so this rule can know them to be available, so we instead
// disable
"node/no-unpublished-import": "off"
}
},
{
// As consumed by jsdoc, cannot be expressed as ESM
files: ["docs/jsdoc-config.js"],
parserOptions: {
sourceType: "script"
},
globals: {
"module": false
},
rules: {
"import/no-commonjs": "off",
"strict": "off"
}
}
],
rules: {
// Override these `ash-nazg/sauron` rules which are difficult for us
// to apply at this time
"default-case": "off",
"require-unicode-regexp": "off",
"max-len": ["off", {
ignoreUrls: true,
ignoreRegExpLiterals: true
}],
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-node-append": "off",
"unicorn/no-zero-fractions": "off"
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhaofu1234/svgedit.git
git@gitee.com:zhaofu1234/svgedit.git
zhaofu1234
svgedit
svgedit
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891