Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/apache/cordova-eslint

Apache Cordova - ESLint
https://github.com/apache/cordova-eslint

cordova eslint javascript

Last synced: 3 months ago
JSON representation

Apache Cordova - ESLint

Awesome Lists containing this project

README

        

# @cordova/eslint-config

[![NPM](https://nodei.co/npm/cordova-eslint.png)](https://nodei.co/npm/cordova-eslint/)

[![Node CI](https://github.com/apache/cordova-eslint/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-eslint/actions?query=branch%3Amaster)

This repository centralizes the ESLint configuration used for Cordova's development.

## Installation

`@cordova/eslint-config` comes with all plugins configs and even `eslint` itself. So all you need to do to get started is:

```shell
npm i -D @cordova/eslint-config
```

## Usage

```yml
# In package.json
{
"scripts": {
"lint": "eslint ."
}
}
```

```yml
# In .eslintrc.yml
root: true

extends: '@cordova/eslint-config/node'

overrides:

- files: [spec/**/*.js]
extends: '@cordova/eslint-config/node-tests'

- files: [cordova-js-src/**/*.js]
extends: '@cordova/eslint-config/browser'
```

## Reference

This package exposes the following shareable ESLint configurations:

### `@cordova/eslint-config/node` (or simply `@cordova`)

For linting scripts intended to be run with Node.js.

### `@cordova/eslint-config/node-tests`

For linting Jasmine tests of Cordova's Node.js scripts.

### `@cordova/eslint-config/browser`

For linting cordova-style CommonJS modules intended to be run in the browser (before they are bundled).

### `@cordova/eslint-config/browser-tests`

For linting Jasmine tests of Cordova's browser code.