Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
module.exports = {
singleQuote: true,
trailingComma: 'es5',
arrowParens: 'always',
};
module.exports = { singleQuote: true };
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,7 @@ module.exports = {
let result;

try {
result = posthtml()
.use(plugin)
.process(content, { sync: true });
result = posthtml().use(plugin).process(content, { sync: true });
} catch (error) {
loaderContext.emitError(error);

Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
collectCoverageFrom: ['src/**/*.js'],
setupFilesAfterEnv: ['<rootDir>/setupTest.js'],
};
4 changes: 2 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
'*.js': ['prettier --write', 'eslint --fix'],
'*.{json,md,yml,css,ts}': ['prettier --write'],
};
1,568 changes: 804 additions & 764 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"lint": "npm-run-all -l -p \"lint:**\"",
"test:only": "cross-env NODE_ENV=test jest",
"test:watch": "npm run test:only -- --watch",
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
"test:coverage": "npm run test:only -- --coverage",
"pretest": "npm run lint",
"test": "npm run test:coverage",
"prepare": "npm run build",
Expand All @@ -43,40 +43,40 @@
"webpack": "^4.0.0 || ^5.0.0"
},
"dependencies": {
"html-minifier-terser": "^5.0.4",
"html-minifier-terser": "^5.0.5",
"htmlparser2": "^4.1.0",
"loader-utils": "^2.0.0",
"parse-srcset": "^1.0.2",
"schema-utils": "^2.6.5"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@webpack-contrib/defaults": "^6.3.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^25.1.0",
"babel-jest": "^25.2.6",
"commitlint-azure-pipelines-cli": "^1.0.3",
"cross-env": "^7.0.2",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"es-check": "^5.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.2",
"file-loader": "^6.0.0",
"handlebars": "^4.7.3",
"handlebars": "^4.7.4",
"husky": "^4.2.3",
"jest": "^25.1.0",
"jest": "^25.2.6",
"jest-junit": "^10.0.0",
"lint-staged": "^10.0.8",
"lint-staged": "^10.1.1",
"memfs": "^3.1.2",
"npm-run-all": "^4.1.5",
"posthtml": "^0.12.0",
"posthtml-webp": "^1.5.0",
"prettier": "^1.19.1",
"prettier": "^2.0.2",
"standard-version": "^7.1.0",
"webpack": "^4.42.0"
},
Expand Down
1 change: 1 addition & 0 deletions setupTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.setTimeout(10000);
5 changes: 2 additions & 3 deletions src/plugins/source-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ const defaultAttributes = [

if (
attributes.type &&
getAttributeValue(attributes, 'type')
.trim()
.toLowerCase() !== 'text/css'
getAttributeValue(attributes, 'type').trim().toLowerCase() !==
'text/css'
) {
return false;
}
Expand Down
8 changes: 1 addition & 7 deletions test/helpers/normalizeErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ function removeCWD(str) {

export default (errors) => {
return errors.map((error) =>
removeCWD(
error
.toString()
.split('\n')
.slice(0, 2)
.join('\n')
)
removeCWD(error.toString().split('\n').slice(0, 2).join('\n'))
);
};
4 changes: 1 addition & 3 deletions test/preprocessor-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ describe("'process' option", () => {
let result;

try {
result = posthtml()
.use(plugin)
.process(content, { sync: true });
result = posthtml().use(plugin).process(content, { sync: true });
} catch (error) {
loaderContext.emitError(error);

Expand Down