diff --git a/package-lock.json b/package-lock.json index 375cd89..b720091 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5089,7 +5089,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -6108,8 +6107,7 @@ "graceful-fs": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", - "dev": true + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" }, "growly": { "version": "1.3.0", @@ -7597,7 +7595,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -11057,8 +11054,7 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, "unset-value": { "version": "1.0.0", diff --git a/package.json b/package.json index 79e440c..e4e24c6 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "webpack": "^4.0.0" }, "dependencies": { + "fs-extra": "^8.1.0", "loader-fs-cache": "^1.0.2", "loader-utils": "^1.2.3", "object-hash": "^1.3.1", @@ -62,7 +63,6 @@ "eslint-config-prettier": "^6.3.0", "eslint-friendly-formatter": "^4.0.1", "eslint-plugin-import": "^2.18.2", - "fs-extra": "^8.1.0", "husky": "^3.0.5", "jest": "^24.9.0", "jest-junit": "^8.0.0", diff --git a/src/Linter.js b/src/Linter.js index e9d0bd7..eea5f5a 100644 --- a/src/Linter.js +++ b/src/Linter.js @@ -1,7 +1,7 @@ import process from 'process'; import { isAbsolute, join } from 'path'; -import { writeFileSync } from 'fs'; +import { writeFileSync, ensureFileSync } from 'fs-extra'; import { interpolateName } from 'loader-utils'; import ESLintError from './ESLintError'; @@ -149,6 +149,7 @@ export default class Linter { ); } + ensureFileSync(filePath); writeFileSync(filePath, content); }