eslint-import-resolver-typescript
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [2.2.0](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/compare/v2.1.0...v2.2.0) (2020-07-30) | ||
### Features | ||
* rename option `directory` to `project` - close [#23](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/issues/23) ([a662fc1](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/commit/a662fc14f6833daf3b7a71f9137d1cbf9abb2b7c)) | ||
## [2.1.0](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/compare/v2.0.0...v2.1.0) (2020-07-30) | ||
@@ -7,0 +14,0 @@ |
@@ -14,3 +14,4 @@ 'use strict'; | ||
var log = debug('eslint-import-resolver-typescript'); | ||
var IMPORTER_NAME = 'eslint-import-resolver-typescript'; | ||
var log = debug(IMPORTER_NAME); | ||
var defaultExtensions = ['.ts', '.tsx', '.d.ts'].concat( | ||
@@ -23,2 +24,3 @@ // eslint-disable-next-line node/no-deprecated-api | ||
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' | ||
* @param {TsResolverOptions} options | ||
*/ | ||
@@ -102,9 +104,12 @@ function resolve(source, file, options) { | ||
} | ||
var isArrayOfStrings = function (array) { | ||
return Array.isArray(array) && array.every(function (o) { return typeof o === 'string'; }); | ||
}; | ||
var configPaths = typeof options.directory === 'string' | ||
? [options.directory] | ||
: isArrayOfStrings(options.directory) | ||
? options.directory | ||
if (options.directory) { | ||
console.warn("[" + IMPORTER_NAME + "]: option `directory` is deprecated, please use `project` instead"); | ||
if (!options.project) { | ||
options.project = options.directory; | ||
} | ||
} | ||
var configPaths = typeof options.project === 'string' | ||
? [options.project] | ||
: Array.isArray(options.project) | ||
? options.project | ||
: [process.cwd()]; | ||
@@ -111,0 +116,0 @@ mappers = configPaths |
@@ -8,3 +8,4 @@ import path from 'path'; | ||
const log = debug('eslint-import-resolver-typescript'); | ||
const IMPORTER_NAME = 'eslint-import-resolver-typescript'; | ||
const log = debug(IMPORTER_NAME); | ||
const defaultExtensions = ['.ts', '.tsx', '.d.ts'].concat( | ||
@@ -17,2 +18,3 @@ // eslint-disable-next-line node/no-deprecated-api | ||
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' | ||
* @param {TsResolverOptions} options | ||
*/ | ||
@@ -96,7 +98,12 @@ function resolve(source, file, options) { | ||
} | ||
const isArrayOfStrings = (array) => Array.isArray(array) && array.every(o => typeof o === 'string'); | ||
const configPaths = typeof options.directory === 'string' | ||
? [options.directory] | ||
: isArrayOfStrings(options.directory) | ||
? options.directory | ||
if (options.directory) { | ||
console.warn(`[${IMPORTER_NAME}]: option \`directory\` is deprecated, please use \`project\` instead`); | ||
if (!options.project) { | ||
options.project = options.directory; | ||
} | ||
} | ||
const configPaths = typeof options.project === 'string' | ||
? [options.project] | ||
: Array.isArray(options.project) | ||
? options.project | ||
: [process.cwd()]; | ||
@@ -103,0 +110,0 @@ mappers = configPaths |
@@ -8,3 +8,4 @@ import path from 'path'; | ||
var log = debug('eslint-import-resolver-typescript'); | ||
var IMPORTER_NAME = 'eslint-import-resolver-typescript'; | ||
var log = debug(IMPORTER_NAME); | ||
var defaultExtensions = ['.ts', '.tsx', '.d.ts'].concat( | ||
@@ -17,2 +18,3 @@ // eslint-disable-next-line node/no-deprecated-api | ||
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' | ||
* @param {TsResolverOptions} options | ||
*/ | ||
@@ -96,9 +98,12 @@ function resolve(source, file, options) { | ||
} | ||
var isArrayOfStrings = function (array) { | ||
return Array.isArray(array) && array.every(function (o) { return typeof o === 'string'; }); | ||
}; | ||
var configPaths = typeof options.directory === 'string' | ||
? [options.directory] | ||
: isArrayOfStrings(options.directory) | ||
? options.directory | ||
if (options.directory) { | ||
console.warn("[" + IMPORTER_NAME + "]: option `directory` is deprecated, please use `project` instead"); | ||
if (!options.project) { | ||
options.project = options.directory; | ||
} | ||
} | ||
var configPaths = typeof options.project === 'string' | ||
? [options.project] | ||
: Array.isArray(options.project) | ||
? options.project | ||
: [process.cwd()]; | ||
@@ -105,0 +110,0 @@ mappers = configPaths |
export declare const interfaceVersion = 2; | ||
export interface TsResolverOptions { | ||
alwaysTryTypes?: boolean; | ||
/** | ||
* @deprecated use `project` instead | ||
*/ | ||
directory?: string | string[]; | ||
project?: string | string[]; | ||
extensions?: string[]; | ||
@@ -11,2 +15,3 @@ packageFilter?: (pkg: Record<string, string>) => Record<string, string>; | ||
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' | ||
* @param {TsResolverOptions} options | ||
*/ | ||
@@ -13,0 +18,0 @@ export declare function resolve(source: string, file: string, options: TsResolverOptions | null): { |
@@ -7,3 +7,4 @@ import path from 'path'; | ||
import debug from 'debug'; | ||
var log = debug('eslint-import-resolver-typescript'); | ||
var IMPORTER_NAME = 'eslint-import-resolver-typescript'; | ||
var log = debug(IMPORTER_NAME); | ||
var defaultExtensions = ['.ts', '.tsx', '.d.ts'].concat( | ||
@@ -16,2 +17,3 @@ // eslint-disable-next-line node/no-deprecated-api | ||
* @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' | ||
* @param {TsResolverOptions} options | ||
*/ | ||
@@ -95,9 +97,12 @@ export function resolve(source, file, options) { | ||
} | ||
var isArrayOfStrings = function (array) { | ||
return Array.isArray(array) && array.every(function (o) { return typeof o === 'string'; }); | ||
}; | ||
var configPaths = typeof options.directory === 'string' | ||
? [options.directory] | ||
: isArrayOfStrings(options.directory) | ||
? options.directory | ||
if (options.directory) { | ||
console.warn("[" + IMPORTER_NAME + "]: option `directory` is deprecated, please use `project` instead"); | ||
if (!options.project) { | ||
options.project = options.directory; | ||
} | ||
} | ||
var configPaths = typeof options.project === 'string' | ||
? [options.project] | ||
: Array.isArray(options.project) | ||
? options.project | ||
: [process.cwd()]; | ||
@@ -104,0 +109,0 @@ mappers = configPaths |
{ | ||
"name": "eslint-import-resolver-typescript", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "TypeScript .ts .tsx module resolver for `eslint-plugin-import`.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/alexgorbatchev/eslint-import-resolver-typescript", |
@@ -72,3 +72,3 @@ # eslint-import-resolver-typescript | ||
"typescript": { | ||
"directory": "path/to/folder" | ||
"project": "path/to/folder" | ||
}, | ||
@@ -80,3 +80,3 @@ | ||
"typescript": { | ||
"directory": "packages/*/tsconfig.json" | ||
"project": "packages/*/tsconfig.json" | ||
}, | ||
@@ -86,3 +86,3 @@ | ||
"typescript": { | ||
"directory": [ | ||
"project": [ | ||
"packages/module-a/tsconfig.json", | ||
@@ -95,3 +95,3 @@ "packages/module-b/tsconfig.json" | ||
"typescript": { | ||
"directory": [ | ||
"project": [ | ||
"packages/*/tsconfig.json", | ||
@@ -98,0 +98,0 @@ "other-packages/*/tsconfig.json" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
214196
611
0