|
| 1 | +import type { RuleConfig } from '../rule-config'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Config. |
| 5 | + */ |
| 6 | +export type NoUnresolvedConfig = { |
| 7 | + /** |
| 8 | + * If `true` is provided, single-argument `require` calls will be resolved. |
| 9 | + * |
| 10 | + * @default false |
| 11 | + * |
| 12 | + * @see [commonjs](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md#options) |
| 13 | + */ |
| 14 | + commonjs?: boolean; |
| 15 | + /** |
| 16 | + * If `true` is provided, dependency paths for `define` and `require` calls will be resolved. |
| 17 | + * |
| 18 | + * @default false |
| 19 | + * |
| 20 | + * @see [amd](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md#options) |
| 21 | + */ |
| 22 | + amd?: boolean; |
| 23 | + /** |
| 24 | + * @see [ignore](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md#ignore) |
| 25 | + */ |
| 26 | + ignore?: string[]; |
| 27 | + /** |
| 28 | + * By default, this rule will report paths whose case do not match the underlying filesystem path, if the FS is not case-sensitive. |
| 29 | + * |
| 30 | + * @default true |
| 31 | + * |
| 32 | + * @see [caseSensitive](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md#casesensitive) |
| 33 | + */ |
| 34 | + caseSensitive?: boolean; |
| 35 | +}; |
| 36 | + |
| 37 | +/** |
| 38 | + * Options. |
| 39 | + */ |
| 40 | +export type NoUnresolvedOptions = [number?, NoUnresolvedConfig?]; |
| 41 | + |
| 42 | +/** |
| 43 | + * Ensures an imported module can be resolved to a module on the local filesystem, as defined by standard Node `require.resolve` behavior. |
| 44 | + * |
| 45 | + * @see [no-unresolved](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md) |
| 46 | + */ |
| 47 | +export type NoUnresolvedRuleConfig = RuleConfig<NoUnresolvedOptions>; |
| 48 | + |
| 49 | +/** |
| 50 | + * Ensures an imported module can be resolved to a module on the local filesystem, as defined by standard Node `require.resolve` behavior. |
| 51 | + * |
| 52 | + * @see [no-unresolved](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md) |
| 53 | + */ |
| 54 | +export interface NoUnresolvedRule { |
| 55 | + /** |
| 56 | + * Ensures an imported module can be resolved to a module on the local filesystem, as defined by standard Node `require.resolve` behavior. |
| 57 | + * |
| 58 | + * @see [no-unresolved](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md) |
| 59 | + */ |
| 60 | + 'import/no-unresolved': NoUnresolvedRuleConfig; |
| 61 | +} |
0 commit comments