eslint-plugin-rules 1.1.0-pr22.1
Install from the command line:
Learn more about npm packages
$ npm install @shiftcode/eslint-plugin-rules@1.1.0-pr22.1
Install via package.json:
"@shiftcode/eslint-plugin-rules": "1.1.0-pr22.1"
About this version
🎯 Target runtime: es2022 (Node >= 18)
⚠️ This module exports code using CommonJS
This module holds some custom eslint plugins written in typescript. See doc
for instructions on how to create custom plugins using typescript-eslint
.
sample .eslintrc.js file:
module.exports = {
// ...
overrides: [
{
plugins: ['@shiftcode/rules'],
files: ['*.ts'],
rules: {
'@shiftcode/rules/import-denylist': [ // former TSLint rule: "import-blacklist"
'error',
{
patterns: [
/aws-cdk-lib\/core/,
/\.\/(core|models|shared|static)\/.*/, // use app/* instead
/^app\/core/, // disallow importing from self
/^somewhat\/.*/, // import filename must never start with "somewhat"
/example$/, // import filename must never end with "example"
// etc ...
]
}
],
},
},
],
// ...
}
the following custom rules are provided within this module:
deny-parent-index-file-import
- imports from parent index files are not allowed; i.e.
import { stuff } from '..'
- note: this rule is already included by @shiftcode/eslint-config-recommended
import-denylist
This can potentially be replaced by using no-restricted-imports
- rule accepts a config-object with a
patterns
regexp array and is the pendant of the former tslint rule "import-blacklist". - example configuration: see above
Details
- eslint-plugin-rules
-
shiftcode
- over 1 year ago
- UNLICENSED
- 3 dependencies
Assets
- eslint-plugin-rules-1.1.0-pr22.1.tgz
Download activity
- Total downloads 93
- Last 30 days 0
- Last week 0
- Today 0