Skip to content

Commit 69b322e

Browse files
committed
feature: @putout/plugin-putout: apply-namespace-specifier: external
1 parent e6c1094 commit 69b322e

File tree

15 files changed

+25
-14
lines changed

15 files changed

+25
-14
lines changed

packages/plugin-for-of/lib/for-entries/index.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import removeUnusedVariables from '@putout/plugin-remove-unused-variables';
1+
import * as removeUnusedVariables from '@putout/plugin-remove-unused-variables';
22
import {createTest} from '@putout/test';
33
import * as forEntries from './index.js';
44

packages/plugin-for-of/lib/for-length/index.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import removeUnusedVariables from '@putout/plugin-remove-unused-variables';
1+
import * as removeUnusedVariables from '@putout/plugin-remove-unused-variables';
22
import {createTest} from '@putout/test';
33
import * as convertForToForOf from './index.js';
44

packages/plugin-for-of/lib/reduce/index.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {createTest} from '@putout/test';
2-
import removeNestedBlocks from '@putout/plugin-remove-nested-blocks';
3-
import removeUnreferencedVariables from '@putout/plugin-remove-unreferenced-variables';
2+
import * as removeNestedBlocks from '@putout/plugin-remove-nested-blocks';
3+
import * as removeUnreferencedVariables from '@putout/plugin-remove-unreferenced-variables';
44
import * as convertMapToForOf from './index.js';
55

66
const test = createTest(import.meta.url, {

packages/plugin-minify/lib/types/index.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {createTest} from '@putout/test';
2-
import conditions from '@putout/plugin-conditions';
2+
import * as conditions from '@putout/plugin-conditions';
33
import * as plugin from './index.js';
44

55
const test = createTest(import.meta.url, {

packages/plugin-nodejs/lib/group-require-by-id/index.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {createTest} from '@putout/test';
2-
import declareBeforeReference from '@putout/plugin-declare-before-reference';
3-
import reuseDuplicateInit from '@putout/plugin-reuse-duplicate-init';
2+
import * as declareBeforeReference from '@putout/plugin-declare-before-reference';
3+
import * as reuseDuplicateInit from '@putout/plugin-reuse-duplicate-init';
44
import * as plugin from './index.js';
55

66
const test = createTest(import.meta.url, {

packages/plugin-printer/.putout.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"match": {
3+
"declare/index.js": {
4+
"putout/apply-namespace-specifier": "off"
5+
},
36
"*.md{js}": {
47
"putout": "off"
58
}

packages/plugin-printer/lib/apply-types/index.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {createTest} from '@putout/test';
2-
import declareBeforeReference from '@putout/plugin-declare-before-reference';
3-
import removeNestedBlocks from '@putout/plugin-remove-nested-blocks';
2+
import * as declareBeforeReference from '@putout/plugin-declare-before-reference';
3+
import * as removeNestedBlocks from '@putout/plugin-remove-nested-blocks';
44
import * as plugin from './index.js';
55

66
const test = createTest(import.meta.url, {

packages/plugin-putout/lib/apply-fixture-name-to-message/index.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {createTest} from '@putout/test';
2-
import pluginTape from '@putout/plugin-tape';
2+
import * as pluginTape from '@putout/plugin-tape';
33
import * as plugin from './index.js';
44

55
const removeOnly = pluginTape.rules['remove-only'];
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {createTest} from '@putout/test';
22

33
import plugin from '../lib/apply-entries.js';
4-
import rmUnused from '@putout/plugin-remove-unused-variables';
4+
import rmUnused from '@putout/x-remove-unused-variables';
55
import progress, {maybeZero} from '../lib/memory.js';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import * as strictMode from '@putout/plugin-nodejs/strict-mode';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import strictMode from '@putout/plugin-nodejs/strict-mode';

packages/plugin-putout/lib/apply-namespace-specifier/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const traverse = ({push, listStore, pathStore}) => ({
1717
pathStore,
1818
push,
1919
names: [
20+
'@putout/plugin-',
2021
'./index.js',
2122
'../lib/index.js',
2223
],
@@ -64,7 +65,7 @@ const createImportVisitor = ({push, names, pathStore = noop}) => ({
6465
return;
6566

6667
for (const name of names) {
67-
if (value === name || name === 'any') {
68+
if (value === name || value.startsWith(name) || name === 'any') {
6869
push({
6970
path,
7071
first,

packages/plugin-putout/lib/apply-namespace-specifier/index.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ test('packages: apply-namaspace-specifier: transform: create-test', (t) => {
3232
t.end();
3333
});
3434

35+
test('packages: apply-namaspace-specifier: transform: external', (t) => {
36+
t.transform('external');
37+
t.end();
38+
});
39+
3540
test('packages: apply-namaspace-specifier: no report: alot', (t) => {
3641
t.noReport('alot');
3742
t.end();

packages/plugin-react-hooks/test/react-hooks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {createTest} from '@putout/test';
2-
import rmUnused from '@putout/plugin-remove-unused-variables';
2+
import * as rmUnused from '@putout/plugin-remove-unused-variables';
33
import * as reactHooks from '../lib/index.js';
44

55
const test = createTest(import.meta.url, {

packages/test/test/format.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {existsSync, writeFileSync} from 'node:fs';
22
import {stub} from 'supertape';
33
import tryToCatch from 'try-to-catch';
4-
import removeConsole from '@putout/plugin-remove-console';
4+
import * as removeConsole from '@putout/plugin-remove-console';
55
import formatter from '@putout/formatter-dump';
66
import formatterProgress from '@putout/formatter-progress';
77
import removeConsoleFixture from './fixture/remove-console.js';

0 commit comments

Comments
 (0)