Lightning Lint Inspection no longer works with the Latest version of SFDX CLI

Issue #2053 resolved
Jason van Beukering created an issue
  • When running Lightning Lint Inspection, the following Error is encountered:
  • Error running Lightning Lint: › Warning: force:lightning:lint is not a sfdx command.Did you mean force:config:list? [y/n]: › Error: Run sfdx help force for a list of available commands.
  • This error appeared after upgrading the sfdx cli to version “ 7.138.1-eb3bf03”
  • Checking the release notes, it appears that the command was removed and that the following plugin should be used instead - “https://github.com/forcedotcom/eslint-plugin-aura”.

Comments (6)

  1. Scott Wells repo owner

    Hi. Thanks for bringing this to my attention. It looks like the entire command force:lightning:lint has been retired in favor of the linked ESLint rules, and those rules are already baked into the standard package.json and aura/.eslintrc.json files that are created for a new SFDX project (and can be easily added to an existing project), e.g.:

    package.json

        "devDependencies": {
            ...
            "@salesforce/eslint-plugin-aura": "^2.0.0",
            ...
        },
    

    aura/.eslintrc.json

    {
        "plugins": ["@salesforce/eslint-plugin-aura"],
        "extends": [
            "plugin:@salesforce/eslint-plugin-aura/recommended",
            "prettier"
        ],
        "rules": {
            "func-names": "off",
            "no-unused-expressions": "off"
        }
    }
    

    I'm not sure if there's anything for IC2 to do here other than perhaps remove its Lightning Lint bulk code inspection since it's no longer relevant.

    Were you specifically looking for something else here?

  2. Jason van Beukering reporter

    HI Scott

    What about non source based project structures. Many of our projects are in the old metadata/org based structures… ? Do we then just add the .eslintrc.json file where appropriate to make it work?

  3. Scott Wells repo owner

    Hi, Jason. Yes, there's nothing source format-specific about having project.json and .eslintrc.json files. You can add those with the specified entries and either run npm install from the CLI or have the JetBrains IDE do it for you, and the IDE's support for ESLint should do the rest. Just make sure that you add the .eslintrc.json file under the aura folder so that it's properly scoped. Otherwise those rules will be applied to LWC, Visualforce, static resources, etc.

  4. Scott Wells repo owner

    Removed the Lightning Lint code inspection in 2.2.0.9 and included the associated Salesforce deprecation/replacement details in the release notes.

  5. Log in to comment