Notes/.eslintrc.cjs

61 lines
1.7 KiB
JavaScript
Raw Normal View History

2019-08-31 20:48:37 +03:00
module.exports = {
2024-03-14 21:33:24 -03:00
extends: [
"ckeditor5",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/stylistic-type-checked",
],
2023-02-06 19:35:50 +01:00
root: true,
2024-03-14 21:33:24 -03:00
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
__tsconfigRootDir: __dirname,
ecmaVersion: "latest",
sourceType: "module",
},
2019-10-01 23:11:51 +03:00
globals: {
2024-03-14 21:33:24 -03:00
MathJax: true,
katex: true,
console: true,
2023-02-06 19:35:50 +01:00
},
ignorePatterns: [
// Ignore the entire `build/` (the DLL build).
2024-03-14 21:33:24 -03:00
"build/**",
2024-03-16 05:35:27 -05:00
// Ignore compiled JavaScript files, as they are generated automatically.
'src/**/*.js',
// Also, do not check typing declarations, too.
'src/**/*.d.ts'
2023-02-06 19:35:50 +01:00
],
rules: {
// This rule disallows importing core DLL packages directly. Imports should be done using the `ckeditor5` package.
// Also, importing non-DLL packages is not allowed. If the package requires other features to work, they should be
// specified as soft-requirements.
// Read more: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/migration/migration-to-26.html#soft-requirements.
2024-03-14 21:33:24 -03:00
"ckeditor5-rules/ckeditor-imports": "error",
2023-02-06 19:35:50 +01:00
// This rule could not be found ???
2024-03-14 21:33:24 -03:00
"ckeditor5-rules/use-require-for-debug-mode-imports": "off",
"no-void": ["error", { allowAsStatement: true }],
2023-02-06 19:35:50 +01:00
},
overrides: [
{
2024-03-16 05:35:27 -05:00
files: [ 'tests/**/*.[jt]s', 'sample/**/*.[jt]s' ],
2023-02-06 19:35:50 +01:00
rules: {
// To write complex tests, you may need to import files that are not exported in DLL files by default.
// Hence, imports CKEditor 5 packages in test files are not checked.
2024-03-14 21:33:24 -03:00
"ckeditor5-rules/ckeditor-imports": "off",
},
},
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
2019-10-01 23:11:51 +03:00
};