@thoughtindustries/eslint-plugin-ti
v1.7.1
Published
Rules specific to Thought Industries
Maintainers
Readme
eslint-plugin-ti
Rules specific to Thought Industries
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-ti:
$ yarn add @thoughtindustries/eslint-plugin-ti --save-devUsage
Add ti to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"ti"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"@thoughtindustries/ti/add-updated-at": ["error", { "indexerPattern": "lms/**/*.js", "limitToIndexedTables": true }],
"@thoughtindustries/ti/run-indexer": ["error", { "indexerPattern": "lms/**/*.js" }],
"@thoughtindustries/ti/use-db-layer": ["error", { "tables": ["translations"] }]
}
}Supported Rules
add-updated-atVerifies thatupdatedAthas been added where needed.indexerPatternRequired. The glob pattern to look for*_indexer.jsfiles.limitToIndexedTables. Optional. If true this will limit the check to indexed tables.run-indexerVerifies that the indexer has been run. E.g.learningPathstable should havelearningPathIndexerrun after the call to the database.indexerPatternRequired. The glob pattern to look for*_indexer.jsfiles.use-db-layerVerifies that any tables that have been updated to use the database layer are using it instead of calling the database directly.
