Skip to content

moqada/eslint-config

Repository files navigation

eslint-config-moqada

NPM version License

My personal ESLint configurations.

Installation

npm install --save-dev eslint eslint-config-moqada eslint-plugin-jsdoc

Usage

Add eslint.config.js.

Summary

  • Base
    • moqada: Default
    • moqada/es5: ES5
  • Optional
    • moqada/browser: Browser env
    • moqada/cli: for CLI (Node.js env)
    • moqada/flow: for Flow
    • moqada/flow-jsdoc: for JSDoc and Flow
    • moqada/node: for Node.js env
    • moqada/react: for React
    • moqada/react-native: for React Native
    • moqada/mocha: for Testing mocha

Examples

ES6 (Node.js)

import configMoqada from 'eslint-config-moqada';
import configMoqadaNode from 'eslint-config-moqada/node';
export default [
  ...configMoqada,
  ...configMoqadaNode,
];
Additional Requirements
npm install --save-dev eslint-plugin-node

ES5 (Browser)

import configMoqadaEs5 from 'eslint-config-moqada/es5';
import configMoqadaBrowser from 'eslint-config-moqada/browser';
export default [
  ...configMoqadaEs5,
  ...configMoqadaBrowser,
];

CLI

import configMoqada from 'eslint-config-moqada';
import configMoqadaCli from 'eslint-config-moqada/cli';
export default [
  ...configMoqada,
  ...configMoqadaCli,
];
Additional Requirements
npm install --save-dev eslint-plugin-node

React

import configMoqada from 'eslint-config-moqada';
import configMoqadaBrowser from 'eslint-config-moqada/browser';
import configMoqadaReact from 'eslint-config-moqada/react';
export default [
  ...configMoqada,
  ...configMoqadaBrowser,
  ...configMoqadaReact,
];
Additional Requirements
npm install --save-dev eslint-plugin-react

React Native

import configMoqada from 'eslint-config-moqada';
import configMoqadaReactNative from 'eslint-config-moqada/react-native';
export default [
  ...configMoqada,
  ...configMoqadaReactNative,
];
Additional Requirements
npm install --save-dev eslint-plugin-react eslint-plugin-react-native

React Native with Flow

import configMoqada from 'eslint-config-moqada';
import configMoqadaReactNative from 'eslint-config-moqada/react-native';
import configMoqadaFlow from 'eslint-config-moqada/flow';
import configMoqadaFlowJsdoc from 'eslint-config-moqada/flow-jsdoc';
export default [
  ...configMoqada,
  ...configMoqadaReactNative,
  ...configMoqadaFlow,
  ...configMoqadaFlowJsdoc,
];
Additional Requirements
npm install --save-dev eslint-plugin-flowtype eslint-plugin-jsdoc eslint-plugin-react eslint-plugin-react-native eslint-plugin-import