From 705232edb7d064f7a1d3e8f4ec838c8a1407db83 Mon Sep 17 00:00:00 2001 From: Ryan Ling Date: Mon, 5 Feb 2024 13:27:48 +1100 Subject: [PATCH] Lint for `fs` usage I forgot to add this in #1367 --- .eslintrc.js | 17 +++++++++++++++++ .../patches/7.3.1/patchServerListener.test.ts | 1 + 2 files changed, 18 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 64382e4df..9a81c7d0e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,6 +12,23 @@ module.exports = { allowAutomaticSingleRunInference: false, }, }, + { + files: [`src/**/*.{${ts}}`], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'fs', + message: + 'Prefer fs-extra as it implements graceful-fs behaviour.', + }, + ], + }, + ], + }, + }, ], rules: { // internal to skuba itself diff --git a/src/cli/configure/upgrade/patches/7.3.1/patchServerListener.test.ts b/src/cli/configure/upgrade/patches/7.3.1/patchServerListener.test.ts index 677dec633..92497866b 100644 --- a/src/cli/configure/upgrade/patches/7.3.1/patchServerListener.test.ts +++ b/src/cli/configure/upgrade/patches/7.3.1/patchServerListener.test.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-restricted-imports -- fs-extra is mocked import fs from 'fs'; import { inspect } from 'util';