Skip to content

Commit ae63ea2

Browse files
committed
refactor: move excludedTransformations array to index.ts
1 parent f76e2c7 commit ae63ea2

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

bin/vue-codemod.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as globby from 'globby'
1010
import createDebug from 'debug'
1111

1212
import builtInTransformations from '../transformations'
13+
import { excludedTransformations } from "../transformations"
1314
import vueTransformations from '../vue-transformations'
1415
import runTransformation from '../src/runTransformation'
1516

@@ -66,19 +67,6 @@ async function main() {
6667
}
6768

6869
if (runAllTransformation) {
69-
const excludedTransformations = [
70-
'define-component',
71-
'new-vue-to-create-app',
72-
'remove-contextual-h-from-render',
73-
'remove-production-tip',
74-
'remove-trivial-root',
75-
'remove-vue-use',
76-
'root-prop-to-use',
77-
'vue-as-namespace-import',
78-
'add-import',
79-
'remove-extraneous-import'
80-
]
81-
8270
for (let key in builtInTransformations) {
8371
if (!excludedTransformations.includes(key)) {
8472
processTransformation(resolvedPaths, key, builtInTransformations[key])

transformations/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,17 @@ const transformationMap: {
3737
'remove-extraneous-import': require('./remove-extraneous-import'),
3838
}
3939

40+
export const excludedTransformations = [
41+
'define-component',
42+
'new-vue-to-create-app',
43+
'remove-contextual-h-from-render',
44+
'remove-production-tip',
45+
'remove-trivial-root',
46+
'remove-vue-use',
47+
'root-prop-to-use',
48+
'vue-as-namespace-import',
49+
'add-import',
50+
'remove-extraneous-import'
51+
]
52+
4053
export default transformationMap

0 commit comments

Comments
 (0)