@next/codemod 16.5.0-canary.52 → 16.5.0-canary.53

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.
@@ -27,6 +27,8 @@ function transformer(file, _api, options) {
27
27
  resolvedPath = path_1.default.resolve(path_1.default.dirname(file.path), value);
28
28
  }
29
29
  exports.globalCssContext.cssImports.add(resolvedPath);
30
+ // TODO(as-any): pre-existing cast, not yet reviewed
31
+ // eslint-disable-next-line @next/internal/no-as-any
30
32
  const { start, end } = path.node;
31
33
  if (!path.parentPath.node.comments) {
32
34
  path.parentPath.node.comments = [];
@@ -39,6 +41,8 @@ function transformer(file, _api, options) {
39
41
  }
40
42
  else if (value.endsWith('.svg')) {
41
43
  const isComponentImport = path.node.specifiers.some((specifier) => {
44
+ // TODO(as-any): pre-existing cast, not yet reviewed
45
+ // eslint-disable-next-line @next/internal/no-as-any
42
46
  return specifier.imported?.name === 'ReactComponent';
43
47
  });
44
48
  if (isComponentImport) {
@@ -34,10 +34,16 @@ function transformer(file, _api, options) {
34
34
  let found = false;
35
35
  if (defaultReactDomImport &&
36
36
  node.callee.type === 'MemberExpression' &&
37
+ // TODO(as-any): pre-existing cast, not yet reviewed
38
+ // eslint-disable-next-line @next/internal/no-as-any
37
39
  node.callee.object.name === defaultReactDomImport &&
40
+ // TODO(as-any): pre-existing cast, not yet reviewed
41
+ // eslint-disable-next-line @next/internal/no-as-any
38
42
  node.callee.property.name === 'render') {
39
43
  found = true;
40
44
  }
45
+ // TODO(as-any): pre-existing cast, not yet reviewed
46
+ // eslint-disable-next-line @next/internal/no-as-any
41
47
  if (hasRenderImport && node.callee.name === 'render') {
42
48
  found = true;
43
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/codemod",
3
- "version": "16.5.0-canary.52",
3
+ "version": "16.5.0-canary.53",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -122,9 +122,17 @@ function replaceFlatCompatInConfig(configPath) {
122
122
  const node = astPath.value;
123
123
  // Detect compat.extends() calls and identify which configs are being used
124
124
  if (node.callee.type === 'MemberExpression' &&
125
+ // TODO(as-any): pre-existing cast, not yet reviewed
126
+ // eslint-disable-next-line @next/internal/no-as-any
125
127
  node.callee.object.type === 'Identifier' &&
128
+ // TODO(as-any): pre-existing cast, not yet reviewed
129
+ // eslint-disable-next-line @next/internal/no-as-any
126
130
  node.callee.object.name === 'compat' &&
131
+ // TODO(as-any): pre-existing cast, not yet reviewed
132
+ // eslint-disable-next-line @next/internal/no-as-any
127
133
  node.callee.property.type === 'Identifier' &&
134
+ // TODO(as-any): pre-existing cast, not yet reviewed
135
+ // eslint-disable-next-line @next/internal/no-as-any
128
136
  node.callee.property.name === 'extends') {
129
137
  // Check arguments for all configs
130
138
  node.arguments.forEach((arg) => {
@@ -147,9 +155,17 @@ function replaceFlatCompatInConfig(configPath) {
147
155
  }
148
156
  // Detect compat.config({ extends: [...] }) calls and identify which configs are being used
149
157
  if (node.callee.type === 'MemberExpression' &&
158
+ // TODO(as-any): pre-existing cast, not yet reviewed
159
+ // eslint-disable-next-line @next/internal/no-as-any
150
160
  node.callee.object.type === 'Identifier' &&
161
+ // TODO(as-any): pre-existing cast, not yet reviewed
162
+ // eslint-disable-next-line @next/internal/no-as-any
151
163
  node.callee.object.name === 'compat' &&
164
+ // TODO(as-any): pre-existing cast, not yet reviewed
165
+ // eslint-disable-next-line @next/internal/no-as-any
152
166
  node.callee.property.type === 'Identifier' &&
167
+ // TODO(as-any): pre-existing cast, not yet reviewed
168
+ // eslint-disable-next-line @next/internal/no-as-any
153
169
  node.callee.property.name === 'config') {
154
170
  // Look for extends property in the object argument
155
171
  node.arguments.forEach((arg) => {