cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sidg
Microsoft
Microsoft

Power Apps ESLint npm package public preview

Please use this thread to discuss feedback/suggestions/concerns on the ESLint rules for Power Apps.

 

How to try this feature?

  1. Install ESLint extension for Visual Studio Code (if not already installed)
  2. Add Power Apps ESLint npm package name and version in the package.json file in build tools
  3. Configure ESLint rules in the eslintrc file
  4. Look for issues in the problems console or inline in your JS/TS code
7 REPLIES 7

Thank you for publishing theses rules!
It would be great to get a base/recommended configuration to extend from similar to other eslint plugins.
This would make it easier to keep up to date with the latest rules added - e.g.

 "extends": [
    ...
    "plugin:microsoft/power-apps/recommended",
  ],

 

filcole
Advocate II
Advocate II

This is great.  If you want to implement this, but have multiple warnings that might take a while to fix take a look at the --max-warnings flag in EsLint when including EsLint in a DevOps pipeline/github workflow. 

 

This allows a code base to be gradually improved in a similar way to warnings thresholds with the solution checker.

 

https://eslint.org/docs/latest/user-guide/command-line-interface#--max-warnings 

npx eslint --max-warnings 10 file.js

or for the current directory and below

npx eslint --max-warnings 10 .

Great suggestion, Scott!  We've added this to our backlog and will enhance the documentation once we've shipped the configurations.

DavidMattson1
New Member

I love this ESLINT rules as they give new devs insight into what is not supported. And they keep more experience devs apprised of issues they may not have previously noticed. This has been my first experience with ESLINT rules as a whole. These are wonderful! However, it is quite possible that I am doing something wrong. I have a js library that I have been modifying to remove all the unsupported Dynamics 365 code. I realized a while into editing it that it has stopped underlining the Dynamics 365 problems. It continues to underline any of the default/OOTB rules I have set up from ESLINT. This happens the same in both VS2022 and VSCode. I started copying and pasting the functions from the original from the modified version of the code to narrow down the issue. When I fix the last line containing Xrm.Page the problems listed ALL disappear. Including things that are still issues like the usage of $() and DOM manipulation 😬. Things I definitely know are unsupported and should be removed from the code base.

Are there any thoughts as to what might be the issue? My workaround for the moment is to leave that line until the last. This is not only happening on this file but others.

dmcweeney
Frequent Visitor

Is there a github site for this package yet?

filcole
Advocate II
Advocate II

I'm not aware of one.  It would be nice to see.  It looks like the source code can be seen after installation of the module in node_modules\@microsoft\eslint-plugin-power-apps.

dmcweeney
Frequent Visitor

I thought it would be a minimum collab requirement at this stage especially for logging issues and requests!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (2,801)