id | slug | title | description | date | tags | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
kibDevDocsOpsEslintPluginEslint |
/kibana-dev-docs/ops/eslint-plugin-eslint |
@kbn/eslint-plugin-eslint |
A package holding an eslint plugin with custom rules used on Kibana |
2022-05-17 |
|
An ESLint plugin exposing custom rules used and built specifically for development within Kibana. Next you can find information on each on.
Disallows a given group of license header texts on a group of files.
module.exports = {
overrides: [
{
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/disallow-license-headers': [
'error',
{
licenses: [
"LICENSE_TEXT"
],
},
],
}
}
]
}
Offers a way to force a migration from a given node module into another as an alternative.
module.exports = {
overrides: [
{
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/module_migration': [
'error',
[
{
from: 'expect.js',
to: '@kbn/expect',
}
],
],
}
}
]
}
Disallows passing an async function to .forEach which will avoid promise rejections from being handled. asyncForEach() or a similar helper from "@kbn/std" should be used instead.
Disallows the usage of an async function as a constructor for a Promise function without a try catch in place.
Disallows the usage of constructor arguments into class property initializers.
Disables the usage of export *
.
Disallows the usage of this
into class property initializers and enforce to define the property value into the constructor.
Disables the usage of a trailing slash in a node module import.
Requires a given license header text on a group of files.
module.exports = {
overrides: [
{
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
{
license: "LICENSE_TEXT"
},
],
}
}
]
}