Code Monkey home page Code Monkey logo

eslint-config-jam3's Introduction

eslint-config-jam3

FOSSA Status

This package exposes the Jam3's ESLint config file for JS based applications.

Installation

Main package

npm i eslint-config-jam3 -D

Secondary packages

Because ESLint only exports a configuration file you need to install all the plugins and configs that this file is depending on.

npm i prettier eslint babel-eslint eslint-plugin-import eslint-plugin-promise eslint-plugin-node eslint-config-prettier eslint-plugin-prettier eslint-config-standard eslint-plugin-standard -D

Usage

Once installed eslint-config-jam3 add jam3 in your extends section of your ESLint configuration

{
  "extends": ["...","jam3"],
  "rules": {
    // ...
  }
}

Tests

To run the tests we are using eslint cli passing our configuration by default, if eslint finds an error in the file it will throw and error.

$ npm test

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Related

License

MIT

FOSSA Status

eslint-config-jam3's People

Contributors

fossabot avatar iranreyes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-jam3's Issues

"Cannot read property '0' of undefined" in no-sanitizer-with-danger.js

I'm getting the "Cannot read property '0' of undefined" error on a TypeScript file, originating from the no-sanitizer-with-danger.js file from the return section after line 80.

I've managed to suppress the error by adding Array.isArray(node.value.expression.properties) to each of the if statements like so:

if (isDangerous(node.name.name) && Array.isArray(node.value.expression.properties) && node.value.expression.properties[0].value.type !== 'CallExpression') { messageIndex = 0; } else if ( isDangerous(node.name.name) && Array.isArray(node.value.expression.properties) && node.value.expression.properties[0].value.type === 'CallExpression' && node.value.expression.properties[0].value.callee.type === 'Identifier' && config.wrapperName.indexOf(node.value.expression.properties[0].value.callee.name) === -1 ) { messageIndex = 1; } else if ( isDangerous(node.name.name) && Array.isArray(node.value.expression.properties) && node.value.expression.properties[0].value.type === 'CallExpression' && node.value.expression.properties[0].value.callee.type !== 'Identifier' ) { messageIndex = 2; }

But the fix isn't ideal and I thought asking one of you could get a better solution. I have a feeling it may be ESLint / TypeScript / Prettier / DOMPurify related as I'm still trying to get ESLint errors to appear after installing DOMPurify/Jam3 to my project.

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.