comment-variables 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/find-all-imports.js +1 -1
- package/index.js +7 -10
- package/package.json +1 -1
package/find-all-imports.js
CHANGED
|
@@ -90,7 +90,7 @@ export const resolveImportPath = (
|
|
|
90
90
|
/* getSourceCodeFromFilePath */
|
|
91
91
|
|
|
92
92
|
// ESLint configs language options
|
|
93
|
-
const typeScriptAndJSXCompatible = {
|
|
93
|
+
export const typeScriptAndJSXCompatible = {
|
|
94
94
|
// for compatibility with .ts and .tsx
|
|
95
95
|
parser: tseslint.parser,
|
|
96
96
|
// for compatibility with JSX
|
package/index.js
CHANGED
|
@@ -7,11 +7,14 @@ import fs from "fs";
|
|
|
7
7
|
import { ESLint } from "eslint";
|
|
8
8
|
|
|
9
9
|
import { runWithConfig } from "./run-with-config.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
findAllImports,
|
|
12
|
+
typeScriptAndJSXCompatible,
|
|
13
|
+
} from "./find-all-imports.js";
|
|
11
14
|
|
|
12
15
|
const cwd = process.cwd();
|
|
13
16
|
|
|
14
|
-
// ENSURES THE CLI TOOL ONLY RUN IN
|
|
17
|
+
// ENSURES THE CLI TOOL ONLY RUN IN FOLDERS THAT POSSESS A package.json FILE AND A .git FOLDER.
|
|
15
18
|
|
|
16
19
|
const hasPackageJson = fs.existsSync(path.join(cwd, "package.json"));
|
|
17
20
|
if (!hasPackageJson) {
|
|
@@ -166,10 +169,7 @@ async function resolveCommentsInProject(fileGlobs = allJSTSFileGlobs) {
|
|
|
166
169
|
{
|
|
167
170
|
files: fileGlobs,
|
|
168
171
|
ignores: [...configIgnores, ...knownIgnores], // 🚫 Ensure config isn't linted
|
|
169
|
-
languageOptions:
|
|
170
|
-
ecmaVersion: "latest",
|
|
171
|
-
sourceType: "module",
|
|
172
|
-
},
|
|
172
|
+
languageOptions: typeScriptAndJSXCompatible,
|
|
173
173
|
plugins: {
|
|
174
174
|
"js-comments": {
|
|
175
175
|
rules: {
|
|
@@ -277,10 +277,7 @@ async function compressCommentsInProject(fileGlobs = allJSTSFileGlobs) {
|
|
|
277
277
|
{
|
|
278
278
|
files: fileGlobs,
|
|
279
279
|
ignores: [...configIgnores, ...knownIgnores], // 🚫 Ensure config isn't linted
|
|
280
|
-
languageOptions:
|
|
281
|
-
ecmaVersion: "latest",
|
|
282
|
-
sourceType: "module",
|
|
283
|
-
},
|
|
280
|
+
languageOptions: typeScriptAndJSXCompatible,
|
|
284
281
|
plugins: {
|
|
285
282
|
"js-comments": {
|
|
286
283
|
rules: {
|