본문 바로가기
심심풀이 개발

eslint 설정 파일

by WebHack 2020. 7. 18.
eslint --init 보안 에러시
PS F:\Tobi\nodejs\eslint> ExecutionPolicy
Restricted
PS F:\Tobi\nodejs\eslint> Set-ExecutionPolicy -Scope CurrentUser
cmdlet Set-ExecutionPolicy(명령 파이프라인 위치 1)
다음 매개 변수에 대한 값을 제공하십시오.
ExecutionPolicy: Unrestricted
PS F:\Tobi\nodejs\eslint> ExecutionPolicy
Unrestricted

npm init -y
npm install eslint -D
eslint --init

 

touch test.js

eslint ./test.js

 

 

 

==================================================

 

module.exports = {

    env: {

        browser: true,

        es2020: true,

        node: true,

        jquery: true,

    },

    extends: [

        'airbnb-base',

        'eslint:recommended',

        'plugin:react/recommended',

    ],

    parserOptions: {

        ecmaFeatures: {

            jsx: true,

        },

        ecmaVersion: 11,

        sourceType: 'module',

    },

    plugins: [

        'react',

    ],

    rules: {

        indent: [

            'error',

            4,

        ],

        quotes: [

            'error',

            'single',

        ],

        semi: [

            'error',

            'always',

        ],

    },

};