From 417bc5d272309feecbb26167d90fbc1b60bfa829 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Fri, 26 Oct 2018 12:21:15 -0400 Subject: [PATCH] clarify import-name rule --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e6ac1de5..5191e3df8 100644 --- a/README.md +++ b/README.md @@ -135,9 +135,10 @@ There certainly are a lot of options! Here are some links to get you started. import-name - The name of the imported module must match the name of the thing being imported. + The name of the imported module must match the name of the thing being imported. For special characters (-, ., _) remove them and make the following character uppercase. For example, it is valid to name imported modules the same as the module name: import Service = require('x/y/z/Service') and import Service from 'x/y/z/Service'. But it is invalid to change the name being imported, such as: import MyCoolService = require('x/y/z/Service') and import MyCoolService from 'x/y/z/Service'. + When containing special characters such as import $$ from 'my-awesome_library'; the corresponding configuration would look like 'import-name': [true, { 'myAwesomeLibrary': '$$' }]. Since version 2.0.9 it is possible to configure this rule with a list of exceptions. For example, to allow underscore to be imported as _, add this configuration: 'import-name': [ true, { 'underscore': '_' }]