|
5 | 5 |
|
6 | 6 | 'use strict';
|
7 | 7 |
|
8 |
| -const has = require('hasown'); |
9 |
| -const repeat = require('string.prototype.repeat'); |
10 |
| - |
11 | 8 | const docsUrl = require('../util/docsUrl');
|
12 |
| -const getSourceCode = require('../util/eslint').getSourceCode; |
| 9 | +const { getSourceCode } = require('../util/eslint'); |
13 | 10 | const report = require('../util/report');
|
14 | 11 |
|
15 | 12 | // ------------------------------------------------------------------------------
|
@@ -84,16 +81,16 @@ module.exports = {
|
84 | 81 | options.selfClosing = config;
|
85 | 82 | } else if (typeof config === 'object') {
|
86 | 83 | // [1, {location: 'something'}] (back-compat)
|
87 |
| - if (has(config, 'location')) { |
| 84 | + if (Object.hasOwn(config, 'location')) { |
88 | 85 | options.nonEmpty = config.location;
|
89 | 86 | options.selfClosing = config.location;
|
90 | 87 | }
|
91 | 88 | // [1, {nonEmpty: 'something'}]
|
92 |
| - if (has(config, 'nonEmpty')) { |
| 89 | + if (Object.hasOwn(config, 'nonEmpty')) { |
93 | 90 | options.nonEmpty = config.nonEmpty;
|
94 | 91 | }
|
95 | 92 | // [1, {selfClosing: 'something'}]
|
96 |
| - if (has(config, 'selfClosing')) { |
| 93 | + if (Object.hasOwn(config, 'selfClosing')) { |
97 | 94 | options.selfClosing = config.selfClosing;
|
98 | 95 | }
|
99 | 96 | }
|
@@ -185,7 +182,7 @@ module.exports = {
|
185 | 182 | }
|
186 | 183 | if (indentation.length + 1 < newColumn) {
|
187 | 184 | // Non-whitespace characters were included in the column offset
|
188 |
| - spaces = repeat(' ', +correctColumn - indentation.length); |
| 185 | + spaces = ' '.repeat(+correctColumn - indentation.length); |
189 | 186 | }
|
190 | 187 | return indentation + spaces;
|
191 | 188 | }
|
|
0 commit comments