@cognite/eslint-plugin v2.1.1
@cognite/eslint-plugin
Custom eslint rules for Cognite's front-end applications.
Installation
You will need to install ESLint:
$ yarn add --dev eslintAnd install eslint-config-cognite:
$ yarn add --dev @cognite/eslint-configNext, install @cognite/eslint-plugin:
$ yarn add --dev @cognite/eslint-pluginUsage
Add cognite to the plugins section of your .eslintrc configuration file. You can omit the /eslint-plugin suffix:
{
"plugins": ["@cognite"]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"@cognite/no-number-z-index": "error"
}
}Supported Presets
Presets are enabled by adding a line to the extends list in your config file. For example, to enable the all preset, use:
{
"extends": ["plugin:@cognite/all"]
}allenables all rules from this plugin.noNumZIndexenables all the rules that prevent numbers with z-indexes.insightenables all rules native to insight.opsupenables all rules native to operations support.
Supported Rules
Here are all the individual rules you can use:
@cognite/no-number-z-index
z-index util should be used.
@cognite/no-sdk-submodule-imports
Importing from @cognite/sdk should only happen from the top-level.
@cognite/no-unissued-todos
TODO's in code require a JIRA ticket.
@cognite/hellip
Ensures that ... is rendered as a horizontal ellipsis.
@cognite/require-t-function
<Trans /> should be passed t as a prop.
@cognite/styled-macro
Make sure that styled-components/macro is correctly used.
3 years ago
3 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago