not-left-hand-side.js 439 B

123456789101112131415
  1. 'use strict';
  2. const not = require('./negation.js');
  3. function notLeftHandSideSelector(path) {
  4. const prefix = path ? `${path}.` : '';
  5. // Keep logic sync with `../utils/is-left-hand-side.js`
  6. return not([
  7. `[${prefix}type="AssignmentExpression"] > .left`,
  8. `[${prefix}type="UpdateExpression"] > .argument`,
  9. `[${prefix}type="UnaryExpression"][${prefix}operator="delete"] > .argument`,
  10. ]);
  11. }
  12. module.exports = notLeftHandSideSelector;