Closed abimaelmartell closed 2 years ago
Do you have your sources files in an src
folder? Do they have a .js
extension?
Yeah, i used the generator, so the structure is the default one for the React Typescript project.
Also, the docs mention that the default pattern is src/**/*.{ts,tsx,js,jsx}
Here is an example i created that also fails with the same error on the linter.
https://github.com/abimaelmartell/excel-stock-price-pane
As you can see i have tsx files on the src.
Usually setting "no-error-on-unmatched-pattern": 0
in .eslintrc.json
fixes this, but oddly this issue is persisting for me even after adding it to my project root's config file and the config file found in office-addin-lint/config
. (I'm doing the same thing as @abimaelmartell, trying to write a taskpane for Excel with Typescript+React.)
Passing --files src/**/*.{ts,tsx}
as an argument still causes ESLint to fail with with the message No files matching the pattern "src/**/*.js" were found
.
Running office-addin-lint --files=src/**/*.{ts,tsx} check
works.
@abimaelmartell Thank you again for reporting this issue. We are not able to reproduce the issue in house. Are you able to create new add-ins using the template, and they all exhibit the same issue?
No additional information provided.
FFR: The true answer is here
office-addin-lint prettier --files="src/**/*.{tsx,ts}"
hth
Is the issue here that TypeScript is used and there are no *.js files? @millerds
@akrantz the issue is that the documentation is unclear how to specify which files to scan for the linter option.
@akrantz, the lint command works just fine when there aren't any .js files present (like in the react template repo) so I don't believe it's a case of which files are present
@rahulahoop the lint package did not include a way to customize the linting that is done as it used its own built-in configuration (the local .eslintrc.json files was for the live linting in VS Code or other editors). However, I just finished publishing an update to the lint package that now looks for the local .eslintrc.json file and uses that over the built in one.
I would also note that there have been a number of updates to the linting tools since this issue was originally opened 1.5 years ago. I would like to see the current versions of the packages used to see if the issue continues (without any local .eslintrc.json overrides).
@abimaelmartell @Keating950 @rahulahoop . . . if you are still seeing issues with this using current versions of the templates and script packages please reopen.
When i run
npm run lint
, i get the following messageI'm writing a taskpane for Excel with Typescript and React. I haven't changed anything on the eslint configuration.
I'm have this on my package.json
Thanks.