Socket
Book a DemoInstallSign in
Socket

@luozhu/eslint-config-react-native

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luozhu/eslint-config-react-native

Luozhu's react eslint config

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
1
Created
Source

@luozhu/eslint-config-react-native

Install

$ yarn add -D @luozhu/eslint-config-react-native eslint prettier typescript @luozhu/prettier-config lint-staged yorkie

自动配置

yarn create @luozhu/create-coding-style
# 类型选择 react-native

手动配置

.eslintrc.js

vscode extension: dbaeumer.vscode-eslint

module.exports = {
  root: true,
  extends: ['@luozhu/eslint-config-react-native'],
};

.prettierrc.js

module.exports = require('@luozhu/prettier-config');

.editorconfig

vscode extension: editorconfig.editorconfig

# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
quote_type = single # Fix Prettier "prettier.singleQuote" not working in 1.40 vs code
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

pre-commit lint

package.json

{
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "**/*.{js,jsx,ts,tsx}": ["eslint --fix"],
    "**/*.{md,json}": ["prettier --write"]
  }
}

.vscode/settings.json

{
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
}

Problem

ESLint plugins used by this config must also be installed within your project. This is a limitation within ESLint.

Related Links:

Temporary Solutions:

Updating babel-eslint to @babel/eslint-parser for React apps

Related Links:

Keywords

luozhu

FAQs

Package last updated on 14 Mar 2023

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