Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(unused): Don't delete imports more than once.
- Loading branch information
Showing
12 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
import "./arrayIncludesShim"; | ||
const server = new Hapi.Server(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
import { ResetTemplateCache } from "./getTemplate"; | ||
~~~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
import { | ||
RequestMethod, | ||
~~~~~~~~~~~~~ [no-unused-declaration] | ||
sendAsanaRequest, | ||
~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
} from "./sendAsanaRequest"; | ||
import "./arrayIncludesShim"; | ||
import { startAsanaTimer } from "./startAsanaTimer"; | ||
~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
const server = new Hapi.Server(); | ||
~~~~~~ [no-unused-declaration] | ||
|
||
[no-unused-declaration]: Unused declarations are forbidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
import "./arrayIncludesShim"; | ||
const server = new Hapi.Server(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
import { | ||
ResetTemplateCache, | ||
~~~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
} from "./getTemplate"; | ||
import { | ||
hasActiveRequest, | ||
~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
RequestMethod, | ||
~~~~~~~~~~~~~ [no-unused-declaration] | ||
sendAsanaRequest, | ||
~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
} from "./sendAsanaRequest"; | ||
import "./arrayIncludesShim"; | ||
import { startAsanaTimer } from "./startAsanaTimer"; | ||
~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
const server = new Hapi.Server(); | ||
~~~~~~ [no-unused-declaration] | ||
|
||
[no-unused-declaration]: Unused declarations are forbidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
// Just import the module to run the code inside and create global Array shim | ||
import "./arrayIncludesShim"; | ||
const server = new Hapi.Server(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as dotenv from "dotenv"; | ||
import * as Hapi from "hapi"; | ||
import * as path from "path"; | ||
dotenv.config({ path: path.join(__dirname, "../.env") }); | ||
import { ResetTemplateCache } from "./getTemplate"; | ||
~~~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
import { | ||
RequestMethod, | ||
~~~~~~~~~~~~~ [no-unused-declaration] | ||
sendAsanaRequest, | ||
~~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
} from "./sendAsanaRequest"; | ||
// Just import the module to run the code inside and create global Array shim | ||
import "./arrayIncludesShim"; | ||
import { startAsanaTimer } from "./startAsanaTimer"; | ||
~~~~~~~~~~~~~~~ [no-unused-declaration] | ||
const server = new Hapi.Server(); | ||
~~~~~~ [no-unused-declaration] | ||
|
||
[no-unused-declaration]: Unused declarations are forbidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"defaultSeverity": "error", | ||
"jsRules": {}, | ||
"rules": { | ||
"no-unused-declaration": { "severity": "error" } | ||
}, | ||
"rulesDirectory": "../../../build/rules" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
|
||
import { b } from "./letters"; | ||
import { b as basil } from "./letters"; | ||
|
||
console.log(b, basil); | ||
console.log("the end"); | ||
|
14 changes: 13 additions & 1 deletion
14
fixtures/no-unused-declaration/unused-imports/fixture.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import { a } from "./letters"; | ||
~ [no-unused-declaration] | ||
import { a as alias } from "./letters"; | ||
import { b } from "./letters"; | ||
import { c, d } from "./letters"; | ||
~ [no-unused-declaration] | ||
~ [no-unused-declaration] | ||
import { a as anise } from "./letters"; | ||
~~~~~ [no-unused-declaration] | ||
import { b as basil } from "./letters"; | ||
import { | ||
c as carrot, | ||
~~~~~~ [no-unused-declaration] | ||
d as dill | ||
~~~~ [no-unused-declaration] | ||
} from "./letters"; | ||
import * as l from "./letters"; | ||
~ [no-unused-declaration] | ||
import letters from "./letters"; | ||
~~~~~~~ [no-unused-declaration] | ||
|
||
console.log(b, basil); | ||
console.log("the end"); | ||
|
||
[no-unused-declaration]: Unused declarations are forbidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters