GithubHelp home page GithubHelp logo

forcedotcom / eslint-plugin-visualforce Goto Github PK

View Code? Open in Web Editor NEW
7.0 10.0 3.0 499 KB

An ESLint plugin to lint inline Javascript containing fields and VisualForce tags inside of VisualForce pages

License: ISC License

JavaScript 100.00%
eslint eslint-plugin visualforce salesforce javascript linter

eslint-plugin-visualforce's Introduction

eslint-plugin-visualforce

Build Status NPM version

This ESLint plugin extracts and lints scripts from VisualForce pages.

It supports VisualForce Expression Language merge fields within the JS syntax. This plugin is a heavily modified fork of eslint-plugin-html developed by Benoît Zugmeyer under ISC license.

License

This plugin is issued under the ISC license.

Usage

Simply install via yard add --dev @salesforce/eslint-plugin-visualforce and add the plugin to your ESLint configuration. See ESLint documentation.

Example:

{
    "plugins": [
        "@salesforce/eslint-plugin-visualforce"
    ],
    "rules": {
      "visualforce/no-atom-expr": "error",
      "visualforce/no-apex-tags": "error",
      "visualforce/jsencode": "error"
    }
}

Note: by default, when executing the eslint command on a directory, only .js files will be linted. You will have to specify extra extensions with the --ext option. Example: eslint --ext .page pages will lint .page files in the pages directory. See ESLint documentation.

Configuring linter-eslint package for the Atom editor

If the language-salesforce plugin is installed simply add source.visualforce under "List of scopes to run ESLint on" at the linter-eslint configuration page.

eslint-plugin-visualforce's People

Contributors

arcanemagus avatar svc-scm avatar touzoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-plugin-visualforce's Issues

Error with eslint 4.11.0 (Latest)

I'm getting this error when trying to run eslint v4.11.0

Plugin works if I downgrade to the last 3.x version.

Cannot read property 'exports' of undefined TypeError: Cannot read property 'exports' of undefined at patchESLint (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:840:41) at Object.<anonymous> (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:980:1) at __webpack_require__ (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:21:30) at Object.<anonymous> (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:1681:18) at __webpack_require__ (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:21:30) at module.exports.Op (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:67:18) at Object.<anonymous> (C:\Users\600119087\AppData\Roaming\npm\node_modules\@salesforce\eslint-plugin-visualforce\dist\index.js:70:10) at Module._compile (module.js:641:30) at Object.Module._extensions..js (module.js:652:10) at Module.load (module.js:560:32)

Please raise required ESLint version to 7 from 3 - conflicts with other sfdx plugins

Trying to install this, as I am having terrible problems with merge fields in JS in Visualforce components.
I get an error that it only supports ESLint 3 - and everything else is up to 7 (or maybe even 8?)

npm i @salesforce/eslint-plugin-visualforce
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.32.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"3" from @salesforce/[email protected]
npm ERR! node_modules/@salesforce/eslint-plugin-visualforce
npm ERR!   @salesforce/eslint-plugin-visualforce@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

This looks like a great plug-in, so can we please update it? VF is still going strong in lots of places!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.