sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

TypeError: eslint.linter.getRules is not a function #38

Closed ndelvalle closed 5 years ago

ndelvalle commented 6 years ago

Runinig prettier-standard 'src/**/*.js' generates the following error:

TypeError: eslint.linter.getRules is not a function
    at formatFilesFromArgv (/usr/local/lib/node_modules/prettier-standard/lib/format-files.js:182:19)
    at _callee$ (/usr/local/lib/node_modules/prettier-standard/lib/index.js:22:72)
    at tryCatch (/usr/local/lib/node_modules/prettier-standard/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/prettier-standard/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/prettier-standard/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/usr/local/lib/node_modules/prettier-standard/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/prettier-standard/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/prettier-standard/node_modules/core-js/library/modules/_export.js:35:28)
    at /usr/local/lib/node_modules/prettier-standard/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12

I'm using node v8.9.3. Any ideas what might be the problem?

sheerun commented 6 years ago

what is the prettier and eslint version in node_modules/eslint/package.json and node_modules/prettier/package.json ?

AutoSponge commented 6 years ago

I have the same error:

cat node_modules/eslint/package.json | grep 'version'
  "version": "2.13.1"
cat node_modules/prettier/package.json | grep 'version'
  "version": "1.9.2"

I installed eslint separately (latest), and everything works.

cat node_modules/eslint/package.json | grep 'version'
  "version": "4.14.0"
sheerun commented 5 years ago

This should be fixed in prettier-standard@9