Skip to content

Commit

Permalink
[Refactor] use hasown instead of the larger object.hasown
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 4, 2024
1 parent eda77f3 commit bcb987a
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/rules/forbid-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const getText = require('../util/eslint').getText;
const isCreateElement = require('../util/isCreateElement');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-closing-bracket-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const repeat = require('string.prototype.repeat');

const docsUrl = require('../util/docsUrl');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-curly-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const getSourceCode = require('../util/eslint').getSourceCode;
const report = require('../util/report');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-max-depth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const includes = require('array-includes');
const variableUtil = require('../util/variable');
const jsxUtil = require('../util/jsx');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-no-duplicate-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const report = require('../util/report');

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-wrap-multilines.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const eslintUtil = require('../util/eslint');
const jsxUtil = require('../util/jsx');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-array-index-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const astUtil = require('../util/ast');
const docsUrl = require('../util/docsUrl');
const pragma = require('../util/pragma');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-danger.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const fromEntries = require('object.fromentries/polyfill')();

const docsUrl = require('../util/docsUrl');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const docsUrl = require('../util/docsUrl');
const getText = require('../util/eslint').getText;
const testReactVersion = require('../util/version').testReactVersion;
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/sort-comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');
const entries = require('object.entries');
const values = require('object.values');
const arrayIncludes = require('array-includes');
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/void-dom-elements-no-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

'use strict';

const has = require('object.hasown/polyfill')();
const has = require('hasown');

const docsUrl = require('../util/docsUrl');
const isCreateElement = require('../util/isCreateElement');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"doctrine": "^2.1.0",
"es-iterator-helpers": "^1.0.19",
"estraverse": "^5.3.0",
"hasown": "^2.0.2",
"jsx-ast-utils": "^2.4.1 || ^3.0.0",
"minimatch": "^3.1.2",
"object.entries": "^1.1.8",
"object.fromentries": "^2.0.8",
"object.hasown": "^1.1.4",
"object.values": "^1.2.0",
"prop-types": "^15.8.1",
"resolve": "^2.0.0-next.5",
Expand Down

0 comments on commit bcb987a

Please sign in to comment.