Skip to content

chowa/eslint-plugin-chowa-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-chowa-standard

npm npm license

Chowa project javascript and typescript syntax standard

Install

npm i eslint-plugin-chowa-standard --save-dev

Usage

If you don't have eslint installed

npm i eslint eslint-loader eslint-friendly-formatter  --save-dev

webpack loader

module.exports = {
    module: {
        rules: [{
            test: /\.(j|t)sx?$/,
            enforce: 'pre',
            use: [
                {
                    loader: 'eslint-loader',
                    options: {
                        emitWarning: true,
                        emitError: true,
                        formatter: require('eslint-friendly-formatter')
                    }
                }
            ]
        }]
    }
}

eslintrc

{
    extends: [
        'plugin:chowa-standard/recommended'
    ]
}

Configuration

React

Install plugin

npm i eslint-plugin-react --save-dev

eslintrc

{
    extends: [
        'plugin:react/recommended',
        'plugin:chowa-standard/recommended'
    ],
    plugins: [
        'react'
    ],
    env: {
        node: false,
        browser: true,
        es6: true
    },
    parserOptions: {
        ecmaVersion: 2017,
        sourceType: 'module',
        jsx: true
    },
    settings: {
        react: {
            pragma: 'React',
            version: 'detect'
        }
    }
}

Typescript

Install plugin and parser

npm i @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev

eslintrc

{
    parser: '@typescript-eslint/parser',
    extends: [
        'plugin:@typescript-eslint/eslint-recommended',
        'plugin:@typescript-eslint/recommended',
        'plugin:chowa-standard/recommended'
    ],
    plugins: [
        '@typescript-eslint'
    ],
    env: {
        node: true,
        es6: true
    },
    parserOptions: {
        ecmaVersion: 2017,
        sourceType: 'module'
    }
}

Releases

No releases published

Packages

No packages published