Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js
rd565449 r0c6b92a 116 116 }; 117 117 118 /** @type {import('eslint').Rule.RuleModule} */ 118 119 module.exports = { 119 120 meta: { … … 227 228 return; 228 229 } 229 node.specifiers.filter(((s) => s.imported)).forEach((specifier) => { 230 checkDeprecation(node, `${MODULES[node.source.value][0]}.${specifier.imported.name}`, specifier); 230 node.specifiers.filter(((s) => 'imported' in s && s.imported)).forEach((specifier) => { 231 // TODO, semver-major: remove `in` check as part of jsdoc->tsdoc migration 232 checkDeprecation(node, 'imported' in specifier && `${MODULES[node.source.value][0]}.${specifier.imported.name}`, specifier); 231 233 }); 232 234 }, … … 234 236 VariableDeclarator(node) { 235 237 const reactModuleName = getReactModuleName(node); 236 const isRequire = node.init && node.init.callee && node.init.callee.name === 'require'; 238 const isRequire = node.init 239 && 'callee' in node.init 240 && node.init.callee 241 && 'name' in node.init.callee 242 && node.init.callee.name === 'require'; 237 243 const isReactRequire = node.init 244 && 'arguments' in node.init 238 245 && node.init.arguments 239 246 && node.init.arguments.length 240 && typeof MODULES[ node.init.arguments[0].value] !== 'undefined';247 && typeof MODULES['value' in node.init.arguments[0] ? node.init.arguments[0].value : undefined] !== 'undefined'; 241 248 const isDestructuring = node.id && node.id.type === 'ObjectPattern'; 242 249 … … 247 254 return; 248 255 } 249 node.id.properties.filter((p) => p.type !== 'RestElement' && p.key).forEach((property) => { 250 checkDeprecation(node, `${reactModuleName || pragma}.${property.key.name}`, property); 256 257 ('properties' in node.id ? node.id.properties : undefined).filter((p) => p.type !== 'RestElement' && p.key).forEach((property) => { 258 checkDeprecation( 259 node, 260 'key' in property && 'name' in property.key && `${reactModuleName || pragma}.${property.key.name}`, 261 property 262 ); 251 263 }); 252 264 },
Note:
See TracChangeset
for help on using the changeset viewer.