Я установил ESLint глобально, используя npm i -g eslint
В другом потоке SO я обнаружил, что аргумент пути необходимо передать в CLI, чтобы использовать --fix
(он не работал сам по себе ).
owner@G700:~/cp/foreignSentenceRepeater$ eslint src --fix
Oops! Something went wrong! :(
ESLint: 7.4.0
No files matching the pattern "src" were found.
Please check for typing mistakes in the pattern.
owner@G700:~/cp/foreignSentenceRepeater$ eslint src/** --fix
Oops! Something went wrong! :(
ESLint: 7.4.0
No files matching the pattern "src/classes" were found.
Please check for typing mistakes in the pattern.
src
определенно там, и что интересно, папка classes
является подпапкой src
, хотя я не упоминал об этом явно.
owner@G700:~/cp/foreignSentenceRepeater$ ls
audioCourse node_modules sentences.txt
compiled package.json silences
configuration.json package-lock.json src
googleCredentials.json readme.md tsconfig.json
Кто-нибудь знает, в чем ошибка?
Обновление 1
В комментарии предлагается попробовать локальную установку:
owner@G700:~/cp/foreignSentenceRepeater$ npm i -D eslint
npm WARN foreign_sentence_repeater@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ eslint@7.4.0
updated 1 package and audited 919 packages in 14.824s
40 packages are looking for funding
run `npm fund` for details
found 4695 vulnerabilities (4693 low, 2 high)
run `npm audit fix` to fix them, or `npm audit` for details
owner@G700:~/cp/foreignSentenceRepeater$ node_modules/eslint/bin/eslint.js src/** --fix
Oops! Something went wrong! :(
ESLint: 7.4.0
No files matching the pattern "src/classes" were found.
Please check for typing mistakes in the pattern.