https://github.com/nativescript/eslint-plugin
ESLint plugin for NativeScript projects.
https://github.com/nativescript/eslint-plugin
Last synced: 8 months ago
JSON representation
ESLint plugin for NativeScript projects.
- Host: GitHub
- URL: https://github.com/nativescript/eslint-plugin
- Owner: NativeScript
- License: apache-2.0
- Created: 2021-03-16T18:15:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T09:59:59.000Z (about 5 years ago)
- Last Synced: 2025-08-23T06:22:27.102Z (10 months ago)
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 10
- Watchers: 6
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# NativeScript ESLint Plugin
ESLint rules for NativeScript projects.
## Installation and setup
1. Install
```
npm i -D @nativescript/eslint-plugin @typescript-eslint/parser eslint
```
2. Add an `.eslintrc.json` config file with the following content.
**.eslintrc.json**
```json
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2015
},
"plugins": ["@nativescript"],
"extends": [
"plugin:@nativescript/recommended"
]
}
```
3. 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.**
4. Fix all auto-fixable problems.
```
npx eslint --ext=ts --fix src/
```
5. [Optional] Set up VSCode to use `eslint`.
- Install the `dbaeumer.vscode-eslint` extension.
- Add the following to your `settings.json` file:
```json
"eslint.validate": [ "typescript", "javascript" ],
```