get-alex / alex

Catch insensitive, inconsiderate writing
https://alexjs.com
MIT License
4.81k stars 207 forks source link

filename must end in '.x' #309

Closed dalelotts closed 3 years ago

dalelotts commented 3 years ago

Subject of the issue

Getting a filename must end in '.x' when running against a .md file.

alex README.md
README.md: filename must end in '.x'

Your environment

Steps to reproduce

This is my actual history!

➜   alex README.md
README.md: filename must end in '.x'

➜   node -v
v12.18.2

➜   nvm use 14
Now using node v14.2.0 (npm v6.14.4)

➜   npm install alex --global

/Users/dalelotts/.nvm/versions/node/v14.2.0/bin/alex -> /Users/dalelotts/.nvm/versions/node/v14.2.0/lib/node_modules/alex/cli.js
+ alex@9.1.0
added 321 packages from 189 contributors in 14.814s

➜   alex README.md
README.md: filename must end in '.x'

// Not sure why I ran this again!
➜   nvm use 14  
Now using node v14.2.0 (npm v6.14.4)

➜   touch foo.md

➜   alex foo.md
foo.md: no issues found

➜   alex README.md

README.md
  180:3-180:10  warning  `Invalid` may be insensitive, use `Turned off`, `Has a disability`, `Person with a disability`, `People with disabilities` instead  invalid  retext-equality
⚠ 1 warning

➜   nvm use 12
Now using node v12.18.2 (npm v6.14.5)

➜   alex README.md
README.md
  180:3-180:10  warning  `Invalid` may be insensitive, use `Turned off`, `Has a disability`, `Person with a disability`, `People with disabilities` instead  invalid  retext-equality

⚠ 1 warning

Expected behaviour

What should happen?

Report any issues with the file

Actual behaviour

Received filename must end in '.x' error

wooorm commented 3 years ago

Hi, thanks for your patience! It looks like you have a different alex installed: https://github.com/simonmar/alex/blob/35f07a1c272c6b3aace858c2b1b0c427a1d89e67/src/Main.hs#L99

dalelotts commented 3 years ago

Thanks for the info and the link. I do have haskell installed also. which alex returns /Users/dalelotts/.nvm/versions/node/v14.2.0/bin/alex and ghc-pkg unregister alex returns ghc-pkg: cannot find package alex

so it seems to be an environmental issue that cleared itself up at some point.