Galooshi/import-js

ImportJS misidentifies `import` methods to be Dynamic Import

Open

#529 aperta il 18 mar 2019

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (70 fork)batch import
bughelp wanted

Metriche repository

Star
 (519 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I just run ImportJS on a huge codebase and the results are mostly good, but this one seemed peculiar enough for me to report it:

I'm not too familiar with the lib, but in this case it broke the code by sorting two variable assignments in false order.

Used ImportJS 3.2.0 on Mac OS, via CLI:

find ./client -name "**.js*" -exec importjs fix --overwrite {} \;
//.importjs.js
module.exports = {
    declarationKeyword: 'import',
    environments: ['meteor', 'node'],
    excludes: ['.meteor/local/**', '.vscode/**'],
    mergableOptions: {
        globals: false,
    },
    useRelativePaths: true
}

Guida contributor