npm

@nativescript/eslint-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

NativeScript ESLint Plugin

ESLint rules for NativeScript projects.

Installation and setup

  1. Install
npm i -D @nativescript/eslint-plugin @typescript-eslint/parser eslint
  1. Add an .eslintrc.json config file with the following content.

.eslintrc.json

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "sourceType": "module",
    "ecmaVersion": 2015
  },
  "plugins": ["@nativescript"],
  "extends": [
    "plugin:@nativescript/recommended"
  ]
}
  1. Lint the project.
npx eslint --ext=ts src/

Notice that you need to provide the path to your source code. In the example above, we use src/. Change that to match your project setup.

  1. Fix all auto-fixable problems.
npx eslint --ext=ts --fix src/
  1. [Optional] Set up VSCode to use eslint.
  • Install the dbaeumer.vscode-eslint extension.
  • Add the following to your settings.json file:
"eslint.validate": [ "typescript", "javascript" ],

Package Sidebar

Install

npm i @nativescript/eslint-plugin

Weekly Downloads

291

Version

0.0.4

License

Apache-2.0

Unpacked Size

101 kB

Total Files

50

Last publish

Collaborators

  • mukaschultze
  • nativescript-user
  • tns-bot
  • lini
  • tachev
  • rosen-vladimirov
  • stoskov
  • rosen_vladimirov
  • walkerrunpdx
  • bradmartin
  • davecoffin
  • rigor789
  • nativescript-bot
  • multishiv19
  • eddyverbruggen
  • edusperoni
  • facetious
  • tdermendjiev
  • sis0k0