agoda-tslint
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -6,4 +6,6 @@ { | ||
"no-mount-and-snapshot": false, | ||
"no-set-timeout-in-test": false | ||
"disallowed-in-tests": false, | ||
"root-relative-imports": false | ||
} | ||
} |
@@ -48,5 +48,5 @@ "use strict"; | ||
.filter(function (value, index, accumulator) { return value && accumulator.indexOf(value) === index; }); | ||
return result.length === 2; | ||
return result && result.length === 2; | ||
}; | ||
return NoMountAndSnapshotWalker; | ||
}(Lint.RuleWalker)); |
{ | ||
"name": "agoda-tslint", | ||
"version": "0.2.0", | ||
"description": "TSLint rules to help with refactoring the code", | ||
"version": "0.3.0", | ||
"description": "A set of TSLint rules used on some Agoda projects.", | ||
"repository": "https://github.com/agoda-com/agoda-tslint.git", | ||
@@ -6,0 +6,0 @@ "author": "Maciej Malkowski <maciej.malkowski@agoda.com>", |
@@ -1,6 +0,5 @@ | ||
[![npm](https://img.shields.io/npm/v/tslint-refactor.svg)](https://www.npmjs.com/package/tslint-refactor) | ||
[![npm](https://img.shields.io/npm/v/agoda-tslint.svg)](https://www.npmjs.com/package/agoda-tslint) | ||
# tslint-refactor | ||
TSLint rules to help with code cleanup. | ||
Idea behind having additional rules apart from the built-in tslint `ban` rule is to enable different levels for different issues in your code. | ||
# agoda-tslint | ||
A set of TSLint rules used on some Agoda projects. | ||
@@ -29,1 +28,17 @@ ## do-not-use | ||
``` | ||
## root-relative-imports | ||
Prevents traversing upwards in directory structure when importing files, forcing the use of root relative imports instead. | ||
Example: | ||
```js | ||
import { MyComponent } from './MyComponent'; -> allowed | ||
import { MyComponent } from './Child/MyComponent'; -> allowed | ||
import { MyComponent } from 'components/MyComponent'; -> allowed | ||
import { MyComponent } from '../components/MyComponent'; -> not allowed | ||
``` | ||
Example usage: | ||
```js | ||
"root-relative-imports": true, | ||
``` |
28782
12
340
44