Skip to content

Commit

Permalink
fix(function-no-unknown): use path.normalize for Windows and Node < 16
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuletik committed Feb 3, 2022
1 parent 8d8dafa commit 299226d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/function-no-unknown/index.js
@@ -1,7 +1,7 @@
'use strict';

const fs = require('fs');
const { URL } = require('url');
const path = require('path');
const valueParser = require('postcss-value-parser');
const functionsListPath = require('css-functions-list');

Expand Down Expand Up @@ -31,8 +31,8 @@ const rule = (primary) => {
return;
}

const path = new URL(functionsListPath.toString(), 'file://');
const functionsList = JSON.parse(fs.readFileSync(path, 'utf8'));
const p = path.normalize(functionsListPath.toString());
const functionsList = JSON.parse(fs.readFileSync(p, 'utf8'));

root.walkDecls((decl) => {
const { value } = decl;
Expand Down

0 comments on commit 299226d

Please sign in to comment.