2020-02-21 08:34:55 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-11-08 06:48:01 +00:00
|
|
|
module.exports = {
|
2020-07-26 18:11:18 +00:00
|
|
|
extends: ['eslint:recommended', 'ash-nazg/sauron-node'],
|
2018-11-16 07:15:17 +00:00
|
|
|
parserOptions: {
|
2020-07-26 18:11:18 +00:00
|
|
|
"ecmaVersion": 10,
|
2020-02-21 08:34:55 +00:00
|
|
|
sourceType: 'module'
|
2018-11-08 06:48:01 +00:00
|
|
|
},
|
2018-11-16 07:15:17 +00:00
|
|
|
env: {
|
2020-07-26 18:11:18 +00:00
|
|
|
browser: true,
|
|
|
|
es6: true
|
2018-11-08 06:48:01 +00:00
|
|
|
},
|
2018-11-16 07:15:17 +00:00
|
|
|
rules: {
|
2020-04-03 00:15:27 +00:00
|
|
|
// check-examples is not picking up eslint config properly in some
|
|
|
|
// environments; see also discussion above
|
|
|
|
// `mocha-cleanup/no-assertions-outside-it`
|
|
|
|
'jsdoc/check-examples': ['warn', {
|
|
|
|
rejectExampleCodeRegex: '^`'
|
|
|
|
}],
|
|
|
|
|
2019-11-30 03:41:01 +00:00
|
|
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/453
|
2020-02-21 08:34:55 +00:00
|
|
|
'unicorn/regex-shorthand': 0,
|
2019-11-16 02:08:38 +00:00
|
|
|
// The Babel transform seems to have a problem converting these
|
2020-02-21 08:34:55 +00:00
|
|
|
'prefer-named-capture-group': 'off',
|
|
|
|
'jsdoc/require-file-overview': ['error', {
|
2019-12-31 17:15:16 +00:00
|
|
|
tags: {
|
|
|
|
file: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
},
|
|
|
|
license: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
},
|
|
|
|
copyright: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
},
|
|
|
|
author: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
},
|
|
|
|
module: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
},
|
|
|
|
exports: {
|
2020-02-21 08:34:55 +00:00
|
|
|
initialCommentsOnly: true,
|
|
|
|
preventDuplicates: true
|
2019-12-31 17:15:16 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-20 07:55:23 +00:00
|
|
|
}],
|
2020-07-26 18:11:18 +00:00
|
|
|
// Warning or Off for now but should be reviewed
|
|
|
|
// Override these rules which are difficult for us
|
|
|
|
// to apply at this time
|
|
|
|
'unicorn/prefer-string-slice': 'off',
|
|
|
|
'default-case': 'off',
|
|
|
|
'require-unicode-regexp': 'off',
|
|
|
|
'max-len': ['warn', { 'ignoreComments': true, 'code': 130 }], // 130 is too much but too many occurences
|
|
|
|
'unicorn/prefer-query-selector': 'off',
|
|
|
|
'unicorn/no-fn-reference-in-iterator': 'off',
|
|
|
|
'unicorn/prefer-node-append': 'off',
|
|
|
|
'unicorn/no-zero-fractions': 'off',
|
|
|
|
'unicorn/prefer-number-properties': 'off',
|
|
|
|
'eslint-comments/require-description': 'off',
|
|
|
|
'compat/compat': 'warn',
|
|
|
|
'consistent-this': 'off',
|
|
|
|
'import/no-anonymous-default-export': 'off',
|
|
|
|
'node/no-unsupported-features/node-builtins': 'warn',
|
|
|
|
'prefer-exponentiation-operator': 'warn'
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
// Locales have no need for importing outside of SVG-Edit
|
|
|
|
// and translations may need a longer line length
|
|
|
|
{
|
|
|
|
files: [
|
|
|
|
'src/editor/locale/lang.*.js', 'src/editor/extensions/ext-locale/**',
|
|
|
|
'docs/tutorials/ExtensionDocs.md'
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
'import/no-anonymous-default-export': 'off',
|
|
|
|
'max-len': 'off'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2018-11-08 06:48:01 +00:00
|
|
|
};
|