Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ENOENT and TypeErrors in function-no-unknown #5916

Merged
merged 1 commit into from Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/rules/function-no-unknown/index.js
@@ -1,7 +1,6 @@
'use strict';

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

Expand Down Expand Up @@ -44,8 +43,7 @@ const rule = (primary, secondaryOptions) => {
return;
}

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

root.walkDecls((decl) => {
const { value } = decl;
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -111,7 +111,7 @@
"balanced-match": "^2.0.0",
"colord": "^2.9.2",
"cosmiconfig": "^7.0.1",
"css-functions-list": "^3.0.0",
"css-functions-list": "^3.0.1",
"debug": "^4.3.3",
"execall": "^2.0.0",
"fast-glob": "^3.2.11",
Expand Down