Coder Social home page Coder Social logo

isabella232 / eslint-config-target-es Goto Github PK

View Code? Open in Web Editor NEW

This project forked from automattic/eslint-config-target-es

0.0 0.0 0.0 36 KB

[READ ONLY] ESLint sharable config to activate eslint-plugin-es checks based on browserslist targets. This repository is a mirror, for issue tracking and development head to: https://github.com/Automattic/Jetpack/

License: Other

JavaScript 100.00%

eslint-config-target-es's Introduction

eslint-config-target-es

ESLint shareable config to activate eslint-plugin-es checks based on browserslist browser targets and MDN browser compatibility data.

Installation

Generally you'll install this via your package manager, e.g.

npm install --save-dev eslint eslint-plugin-es @automattic/eslint-config-target-es

Usage

First, you'll probably want to set up a browserslist configuration.

Then you can use this like any other sharable config in your .eslintrc.* file. Three configurations are offered.

To check only for language features, such as nullish coalescing, your eslintrc might look like

{
	extends: [ '@automattic/eslint-config-target-es/language' ],
}

To check only for builtins, such as Promise, WeakRef, and various features of RegExp, your eslintrc might look like

{
	extends: [ '@automattic/eslint-config-target-es/builtins' ],
}

To check both, your eslintrc might look like

{
	extends: [ '@automattic/eslint-config-target-es/all' ],
}

For least surprise, omitting any suffix is the same as /all.

Checking built files

If you want to check your built files to make sure you didn't omit transpiling any packages that need transpiling, you might create a validate-es.config.js like this

module.exports = {
	root: true,
	extends: [ '@automattic/eslint-config-target-es/language' ],
	env: {
		// Whatever environments you need.
	},
};

and then run eslint like

eslint --no-eslintrc --no-inline-config --config validate-es.config.js --no-ignore build/

to avoid your standard eslintrc and eslintignore and to avoid errors from any inline directives.

Advanced usage

You can import or require @automattic/eslint-config-target-es/functions to gain access to some functions that can be used to build your own configuration.

As browserslist and MDN use different browser codes, getBrowsers( { query: } ) will take a browserslist query and return an object with the MDN browser codes and the minimum matched version for each.

getRules( { query:, builtins: } ) will return the rules config. Set builtins true for "builtins", false for "language", or null/undefined for "all".

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

eslint-config-target-es is licensed under GNU General Public License v2 (or later)

--

eslint-config-target-es's People

Contributors

anomiex avatar jeherve avatar kraftbj avatar manzoorwanijk avatar samiff avatar

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.