ESLint rules for NativeScript projects.
npm i -D @nativescript/eslint-plugin @typescript-eslint/parser eslint
.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"
]
}
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.
npx eslint --ext=ts --fix src/
eslint
.dbaeumer.vscode-eslint
extension.settings.json
file:"eslint.validate": [ "typescript", "javascript" ],