1.1.2 • Published 7 months ago

@computools/eslint-config-react-native v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

@computools/eslint-config-react-native

npm version

Computools eslint configuration for React Native.

Usage

Install peerDependencies:

yarn add -D @typescript-eslint/parser

Install current package:

yarn add -D @computools/eslint-config-react-native

In .eslintrc.js:

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

Using Custom Path Aliases:

Install peerDependencie:

yarn add -D babel-plugin-module-resolver eslint-import-resolver-babel-module

tsconfig.json:

{
  "extends": "@tsconfig/react-native/tsconfig.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["./*"],
      "@app/*": ["src/*"]
    }
  }
}

babel.config.js:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      'module-resolver',
      {
        extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
        root: ['./src'],
        alias: {
          '*': '.',
          '@app': './src/app',
        },
      },
    ],
  ],
};

.eslintrc.js:

module.exports = {
  root: true,
  extends: ['@computools/eslint-config-react-native'],
  plugins: ['@typescript-eslint'],
  parser: '@typescript-eslint/parser',
  rules: {
    'react/jsx-filename-extension': ['error', {extensions: ['.ts', '.tsx']}],
  },
  settings: {
    'import/resolver': {
      node: {
        extensions: [
          '.js',
          '.jsx',
          '.ts',
          '.tsx',
          '.d.ts',
          '.android.js',
          '.android.jsx',
          '.android.ts',
          '.android.tsx',
          '.ios.js',
          '.ios.jsx',
          '.ios.ts',
          '.ios.tsx',
          '.web.js',
          '.web.jsx',
          '.web.ts',
          '.web.tsx',
        ],
      },
      'babel-module': {},
    },
  },
};
1.1.1

8 months ago

1.1.0

8 months ago

1.0.4

10 months ago

1.1.2

7 months ago

1.0.3

10 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.17

1 year ago

1.0.16

2 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago