daidodo / format-imports

JavaScript and TypeScript Import/Export Sorter
MIT License
47 stars 2 forks source link

Help: Can't include multiple directories with CLI flag, or exclude node_modules with config #22

Open vincerubinetti opened 1 year ago

vincerubinetti commented 1 year ago

Thanks for making this tool, it's great! This is more of a question or request for help. I would've made a discussion instead of an issue if they were enabled.

I'm basically trying to run this plugin recursively on a few select folders in my repo: src, unit, and e2e. Here's the setup I have:

package.json

{
  "scripts": {
    "sort-imports": "npx format-imports --config ./import-sorter.json --log ./src",
  }
}

import-sorter.json

{
  "autoFormat": "off",
  "emptyLinesBetweenGroups": 0,
  "formatExports": false,
  "wrappingStyle": "prettier",
  "groupRules": ["^vue", "^\\w", "^@\\w", "^@\\/", { "flags": "scripts" }]
}

I've looked through the docs and tried a few things. If I append ./unit ./e2e to the command, like the docs say I can do, I simply get errors like Command failed with exit code 1.. I've also tried using the exclude and excludeGlob config options to exclude the most time consuming directories, node_modules and dist, but no matter what variation I try, the plugin runs on node_modules and takes an impractical amount of time.

One thing to possibly note is that I'm running this in a subdirectory in a monorepo, /frontend. I'm running the commands and everything relative to this directory, but in VS Code the project folder I have open is one level up, so maybe that is messing things up.

Could you advise some things to try?

daidodo commented 1 year ago

Thanks for the feedback!

Could you share more details about:

vincerubinetti commented 1 year ago

Indeed, I'll try to get back to you with a minimum reproducible example soon. I was just wondering if you could spot any errors in my config above or your code just off the cuff.

vincerubinetti commented 1 year ago

Here is a minimal reproducible example:

repo.zip

First, cd into /frontend.

I want to format /src, /e2e, /unit, but NOT /node_modules.

This works, if I just want to format /src:

npx format-imports --config ./import-sorter.json --log ./src

This part of the docs suggests you can specify multiple directories in a single command, but apparently only with --check and not formatting:

npx format-imports --config ./import-sorter.json --log ./src ./e2e ./unit

As an alternative, with "exclude": ["node_modules"] in the config file, I should be able to do this:

npx format-imports --config ./import-sorter.json --log ./

... but this still seems to scan node_modules anyway. Maybe it doesn't actually format it, but it still takes a really long time and shouldn't be scanned.

vincerubinetti commented 1 year ago

So, to sum up:

I think this:

Screenshot 2023-05-09 at 4 37 31 PM

Should support multiple directories like this does:

Screenshot 2023-05-09 at 4 37 49 PM

AND

"exclude": ["node_modules"] seems to not work. I'm not sure if it formats node_modules, but it definitely scans all of it:

Log ```sh [2023-05-09T16:40:43.231] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLess.js [2023-05-09T16:40:43.231] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.231] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.231] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.231] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.231] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.231] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.d.ts [2023-05-09T16:40:43.232] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.d.ts and use default provided [2023-05-09T16:40:43.232] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.234] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.234] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.234] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.234] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.d.ts [2023-05-09T16:40:43.234] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.234] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.234] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.234] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.234] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.234] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.js [2023-05-09T16:40:43.234] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.js and use default provided [2023-05-09T16:40:43.234] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.236] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.236] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.237] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.237] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLine.js [2023-05-09T16:40:43.237] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.237] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.237] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.237] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.237] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.237] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.d.ts [2023-05-09T16:40:43.237] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.d.ts and use default provided [2023-05-09T16:40:43.237] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.240] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.240] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.240] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.240] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.d.ts [2023-05-09T16:40:43.240] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.240] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.240] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.240] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.240] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.240] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.js [2023-05-09T16:40:43.241] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.js and use default provided [2023-05-09T16:40:43.241] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.243] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.243] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.243] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.243] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedin.js [2023-05-09T16:40:43.243] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.244] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.244] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.244] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.244] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.244] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.d.ts [2023-05-09T16:40:43.244] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.d.ts and use default provided [2023-05-09T16:40:43.244] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.246] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.246] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.246] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.246] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.d.ts [2023-05-09T16:40:43.246] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.247] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.247] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.247] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.247] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.247] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.js [2023-05-09T16:40:43.247] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.js and use default provided [2023-05-09T16:40:43.247] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.249] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.249] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.249] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.249] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinkedinIn.js [2023-05-09T16:40:43.249] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.249] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.250] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.250] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.250] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.250] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.d.ts [2023-05-09T16:40:43.250] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.d.ts and use default provided [2023-05-09T16:40:43.250] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.252] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.252] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.252] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.252] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.d.ts [2023-05-09T16:40:43.252] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.252] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.252] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.252] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.252] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.252] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.js [2023-05-09T16:40:43.253] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.js and use default provided [2023-05-09T16:40:43.253] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.256] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.256] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.256] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.256] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinode.js [2023-05-09T16:40:43.256] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.256] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.257] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.257] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.257] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.257] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.d.ts [2023-05-09T16:40:43.257] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.d.ts and use default provided [2023-05-09T16:40:43.257] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.259] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.259] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.259] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.259] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.d.ts [2023-05-09T16:40:43.259] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.259] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.259] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.259] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.259] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.260] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.js [2023-05-09T16:40:43.260] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.js and use default provided [2023-05-09T16:40:43.260] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.262] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.262] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.262] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.262] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLinux.js [2023-05-09T16:40:43.262] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.262] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.262] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.262] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.262] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.262] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.d.ts [2023-05-09T16:40:43.263] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.d.ts and use default provided [2023-05-09T16:40:43.263] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.265] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.265] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.265] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.265] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.d.ts [2023-05-09T16:40:43.265] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.265] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.265] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.265] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.265] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.266] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.js [2023-05-09T16:40:43.266] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.js and use default provided [2023-05-09T16:40:43.266] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.268] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.268] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.268] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.268] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faLyft.js [2023-05-09T16:40:43.268] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.268] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.268] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.268] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.269] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.269] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.d.ts [2023-05-09T16:40:43.269] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.d.ts and use default provided [2023-05-09T16:40:43.269] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.271] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.271] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.271] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.271] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.d.ts [2023-05-09T16:40:43.271] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.271] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.271] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.271] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.271] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.271] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.js [2023-05-09T16:40:43.272] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.js and use default provided [2023-05-09T16:40:43.272] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.274] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.274] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.274] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.274] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMagento.js [2023-05-09T16:40:43.274] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.274] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.274] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.274] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.274] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.274] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.d.ts [2023-05-09T16:40:43.275] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.d.ts and use default provided [2023-05-09T16:40:43.275] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.277] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.277] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.277] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.277] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.d.ts [2023-05-09T16:40:43.277] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.277] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.277] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.277] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.277] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.277] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.js [2023-05-09T16:40:43.278] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.js and use default provided [2023-05-09T16:40:43.278] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.280] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.280] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.280] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.280] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMailchimp.js [2023-05-09T16:40:43.280] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.280] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.280] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.280] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.280] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.280] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.d.ts [2023-05-09T16:40:43.280] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.d.ts and use default provided [2023-05-09T16:40:43.280] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.282] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.282] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.283] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.283] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.d.ts [2023-05-09T16:40:43.283] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.283] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.283] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.283] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.283] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.283] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.js [2023-05-09T16:40:43.283] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.js and use default provided [2023-05-09T16:40:43.283] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.285] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.285] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.285] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.285] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMandalorian.js [2023-05-09T16:40:43.286] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.286] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.286] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.286] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.286] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.286] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.d.ts [2023-05-09T16:40:43.286] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.d.ts and use default provided [2023-05-09T16:40:43.286] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.288] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.288] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.288] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.288] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.d.ts [2023-05-09T16:40:43.288] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.288] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.288] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.288] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.288] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.289] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.js [2023-05-09T16:40:43.289] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.js and use default provided [2023-05-09T16:40:43.289] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.291] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.291] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.291] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.291] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMarkdown.js [2023-05-09T16:40:43.292] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.292] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.292] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.292] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.292] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.292] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.d.ts [2023-05-09T16:40:43.292] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.d.ts and use default provided [2023-05-09T16:40:43.292] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.294] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.294] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.294] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.294] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.d.ts [2023-05-09T16:40:43.294] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.294] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.294] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.294] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.295] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.295] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.js [2023-05-09T16:40:43.295] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.js and use default provided [2023-05-09T16:40:43.295] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.297] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.297] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.297] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.297] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMastodon.js [2023-05-09T16:40:43.297] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.297] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.297] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.297] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.297] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.297] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.d.ts [2023-05-09T16:40:43.297] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.d.ts and use default provided [2023-05-09T16:40:43.297] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.299] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.299] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.299] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.299] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.d.ts [2023-05-09T16:40:43.300] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.300] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.300] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.300] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.300] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.300] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.js [2023-05-09T16:40:43.300] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.js and use default provided [2023-05-09T16:40:43.300] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.302] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.302] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.302] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.302] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMaxcdn.js [2023-05-09T16:40:43.303] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.303] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.303] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.303] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.303] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.303] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.d.ts [2023-05-09T16:40:43.303] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.d.ts and use default provided [2023-05-09T16:40:43.303] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.305] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.305] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.305] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.305] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.d.ts [2023-05-09T16:40:43.305] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.305] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.305] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.305] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.305] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.305] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.js [2023-05-09T16:40:43.306] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.js and use default provided [2023-05-09T16:40:43.306] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 [2023-05-09T16:40:43.308] [DEBUG] format-imports.loadPretConfig - Prettier config: null [2023-05-09T16:40:43.308] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json [2023-05-09T16:40:43.308] [DEBUG] format-imports.fileConfig - Found JSON file /Users/vincerubinetti/Desktop/repo/frontend/import-sorter.json and config: { autoFormat: 'off', emptyLinesBetweenGroups: 0, formatExports: false, wrappingStyle: 'prettier', exclude: [ 'node_modules' ], groupRules: [ { flags: 'scripts', regex: '^a' }, { flags: 'scripts', regex: '^b' }, { flags: 'scripts', regex: '^c' } ] } [2023-05-09T16:40:43.308] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMdb.js [2023-05-09T16:40:43.308] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json [2023-05-09T16:40:43.308] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/package.json and config: undefined [2023-05-09T16:40:43.308] [DEBUG] format-imports.packageConfig - Found package.json in /Users/vincerubinetti/Desktop/repo/frontend/package.json [2023-05-09T16:40:43.308] [DEBUG] format-imports.packageConfig - Found package.json /Users/vincerubinetti/Desktop/repo/frontend/package.json and config: undefined [2023-05-09T16:40:43.308] [DEBUG] format-imports.enhanceEol - Determining EOL [2023-05-09T16:40:43.308] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMedapps.d.ts [2023-05-09T16:40:43.308] [WARN] require-module.requireModule - Cannot find prettier from path: /Users/vincerubinetti/Desktop/repo/frontend/node_modules/@fortawesome/free-brands-svg-icons/faMedapps.d.ts and use default provided [2023-05-09T16:40:43.308] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.7 ^C Vincents-MacBook-Pro:frontend vincerubinetti$ ```

I don't think it should scan it, because that will take an enormous amount of time. The real project I'm using this in has 2x the packages in package.json that the minimal reproducible example above has, and it's just impractical to way for this package to scan all of node_modules every time.

daidodo commented 1 year ago

I think you discussed 2 issues:

  1. format-imports ./ is too slow and you suspected node_modules/ are formatted
  2. Supporting multiple directories

For 1, I don't think node_modules/ are formatted after testing your repo on my laptop. The long time is because the tool needs to find out all files (including node_modules/) and check if they need process.

For 2, it's a design decision to support single directory because you can't specify -o if there are multiple directories. The workaround is format-imports dir1/ && format-imports dir2/ && ....

vincerubinetti commented 1 year ago

For 2, it's a design decision to support single directory because you can't specify -o if there are multiple directories. The workaround is format-imports dir1/ && format-imports dir2/ && ....

This is understandable.

For 1, I don't think _nodemodules/ are formatted after testing your repo on my laptop. The long time is because the tool needs to find out all files (including _nodemodules/) and check if they need process.

In my repo, it takes ~2 minutes to complete scanning node_modules on a (very fast) M1 Macbook. I'd expect exclude to ignore matches completely, like a .gitignore, and not just ignore them for formatting.

I'm not sure how your code is selecting/filtering files and directories recursively, but you may want to consider using the glob package for more conventional selecting/filtering behavior.

format-imports dir1/ && format-imports dir2/ && ...

This is fine but will get pretty lengthy and full of code duplication with a longer command: npx format-imports --config ./import-sorter.json --log dir.

daidodo commented 1 year ago

Here is the code for handling exclude: https://github.com/daidodo/format-imports/blob/main/src/lib/config/index.ts#L39

Happy to receive PRs if you think it can be improved.

Thanks!

laser commented 1 year ago

In my repo, it takes ~2 minutes to complete scanning node_modules on a (very fast) M1 Macbook. I'd expect exclude to ignore matches completely, like a .gitignore, and not just ignore them for formatting.

I'm in the same boat. Doing something like "exclude": ["node_modules"] in my import-sorter.json file does prevent the tool from reformatting the sources in node_modules, but doesn't prevent the tool from scanning the directory, which takes O(minute).

vincerubinetti commented 1 year ago

For what it's worth, I ended up switching to a prettier plugin for this, @ianvs/prettier-plugin-sort-imports. It works really well for me, integrating into a tool I'm already using for formatting and testing formatting, instead of a separate command I have to run. It also makes sense to me to be a Prettier plugin since it's just formatting and doesn't affect code functionality.

I appreciate the hard work that went into this library, but that plugin ended up being a smoother experience, both with integration and configuration. I think this library has more options though. Perhaps the author here could consider porting this to a Prettier plugin.

laser commented 1 year ago

@vincerubinetti - Yeah, that makes sense. I use WebStorm, which has first-class support for Prettier, so making the switch to prettier-plugin-sort-imports was a bit of a no-brainer after I ran into the same issue that you did. Thanks for the tip.