eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.23k stars 867 forks source link

npx not finding source files #933

Open Bow2Jesus opened 3 years ago

Bow2Jesus commented 3 years ago

Using version 1.10.0 - the latest version in Sonatype

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

The npx executor executes the eslint node package but does not list any issues to fix. Instead I get back the "no files found" message.

If the current behavior is a bug, please provide the steps to reproduce.

In your pom file add this execution to the executions for frontend-maven-plugin:

                        <execution>
                            <id>run eslint</id>
                            <goals>
                                <goal>npx</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <arguments>eslint . --ext ts</arguments>
                            </configuration>
                        </execution>

What is the expected behavior?

A list of errors found in TypeScript files by eslint that need fixing. That is what is produced if I do this by using the npm goal instead of the npx goal like this:

                        <execution>
                            <id>run eslint</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                            <phase>process-sources</phase>
                            <configuration>
                                <arguments>run lint</arguments>
                            </configuration>
                        </execution>

This runs the following lint script in my package.json file:

    "lint": "eslint . --ext ts",

Please mention your frontend-maven-plugin and operating system version.

frontend-maven-plugin version 1.10.0 Windows 7 eslint version ^7.9.0

holgergp commented 3 years ago

Hi,

Does eslint . --ext ts or npm run lint work as expected when run on their own without maven? You could try adding --debug and post the output. That being said: The value you provide to the extension parameter looks suspicious to me. I think you are missing a dot there. And the order of the arguments seems to be wrong. The input files should be last parameter. Please refer to this. You could try this command eslint --ext .ts . Does that work?