Skip to content

Commit 0600fb2

Browse files
committed
chore: apply linter fixes
1 parent c3e01c7 commit 0600fb2

9 files changed

Lines changed: 10 additions & 23 deletions

File tree

src/find-path.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict';
2-
3-
const path = require('path');
4-
const {existsSync} = require('fs');
1+
const path = require('node:path');
2+
const {existsSync} = require('node:fs');
53

64
const folderSeparator = '.';
75

src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export type PostHTMLComponents = {
182182
*
183183
*
184184
*/
185+
// biome-ignore lint: using `any` until we can do better
185186
mergeCustomizer?: (objValue: any, srcValue: any) => any;
186187

187188
/**

src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict';
2-
3-
const {readFileSync, existsSync} = require('fs');
4-
const path = require('path');
1+
const {readFileSync, existsSync} = require('node:fs');
2+
const path = require('node:path');
53
const {parser} = require('posthtml-parser');
64
const {match, walk} = require('posthtml/lib/api');
75
const expressions = require('posthtml-expressions');
@@ -244,7 +242,7 @@ function processTree(options) {
244242
* 'undefined' or 'null'.
245243
*/
246244
walk.call(currentNode, node => {
247-
if (node && node.attrs) {
245+
if (node?.attrs) {
248246
for (const key in node.attrs) {
249247
if (node.attrs[key] === 'undefined' || node.attrs[key] === 'null') {
250248
delete node.attrs[key];

src/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {inspect} = require('util');
1+
const {inspect} = require('node:util');
22

33
const debug = false;
44

src/process-attributes.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const {match} = require('posthtml/lib/api');
42
const parseAttrs = require('posthtml-attrs-parser');
53
const styleToObject = require('style-to-object').default;

src/process-props.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const pick = require('lodash/pick');
42
const assign = require('lodash/assign');
53
const mergeWith = require('lodash/mergeWith');

src/process-script.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict';
2-
3-
const vm = require('vm');
4-
const {existsSync, readFileSync} = require('fs');
1+
const vm = require('node:vm');
2+
const {existsSync, readFileSync} = require('node:fs');
53
const {render} = require('posthtml-render');
64
const {match} = require('posthtml/lib/api');
75

src/process-slots.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const {match} = require('posthtml/lib/api');
42
const {render} = require('posthtml-render');
53
const omit = require('lodash/omit');
@@ -25,7 +23,7 @@ function setFilledSlots(currentNode, filledSlots, {fill, slotSeparator, propsSlo
2523

2624
if (props) {
2725
for (const key in props) {
28-
if (props.hasOwnProperty(key)) {
26+
if (Object.hasOwn(props, key)) {
2927
try {
3028
props[key] = JSON.parse(props[key]);
3129
} catch {}

src/process-stacks.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const {match} = require('posthtml/lib/api');
42
const {render} = require('posthtml-render');
53
const get = require('lodash/get');

0 commit comments

Comments
 (0)