New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lint-react-native-app

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lint-react-native-app

A command-line interface that adds linting and prettier to a `react` / `react-native` project. It primarily targets `expo`.

latest
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

🤓 lint-react-native-app

A command-line interface that adds linting and prettier to a react / react-native project. It primarily targets expo.

Originally inspired by this article with additions to cover pieces it misses.

Install

Run this after running expo init (or from react-native cli):

$ npx lint-react-native-app

This will create a .prettierrc.json and .eslintrc.json file for you.

It supports TypeScript, React Hooks linters, and other recommended react / react-native linter dependencies.

ESLint file created: .eslintrc.json

{
	"parser": "@typescript-eslint/parser",
	"parserOptions": {
		"jsx": true,
		"useJSXTextNode": true
	},
	"extends": [
		"plugin:@typescript-eslint/recommended",
		"prettier",
		"prettier/@typescript-eslint"
	],
	"plugins": ["@typescript-eslint", "react-hooks"],
	"rules": {
		"@typescript-eslint/explicit-function-return-type": "off",
		"react-hooks/rules-of-hooks": "error",
		"react-hooks/exhaustive-deps": "warn"
	}
}

Prettier file created: `.prettierrc.json

{
	"singleQuote": true,
	"trailingComma": "es5",
	"overrides": [
		{
			"files": "*.ts",
			"options": {
				"parser": "typescript"
			}
		}
	],
	"semi": false,
	"jsxSingleQuote": false,
	"useTabs": true,
	"tabWidth": 4
}

These packages will be added to your devDependencies:

"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
"eslint",
"eslint-config-prettier",
"eslint-plugin-prettier",
"eslint-plugin-react",
"eslint-plugin-react-hooks",
"prettier"

FAQs

Package last updated on 07 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts