자주쓰는 prettier, eslint, stylelint 설정 > IT 기술백서

IT 기술백서

Web/APP/IT 전반에 대한 기술 연구소

JavaScript | 자주쓰는 prettier, eslint, stylelint 설정

본문

.prettierrc

[code]

{

  "semi": false,

  "singleQuote": true,

  "printWidth": 80,

  "tabWidth": 2,

  "useTabs": false,

  "trailingComma": "es5",

  "bracketSpacing": true,

  "jsxBracketSameLine": false,

  "proseWrap": "never",

  "endOfLine": "auto",

}

[/code]

 

.eslintrc.js

[code]

module.exports = {

  root: true,

  env: {

    browser: true,

    node: true,

  },

  parserOptions: {

    parser: 'babel-eslint',

  },

  extends: [

    '@nuxtjs',

    'prettier',

    'prettier/vue',

    'plugin:prettier/recommended',

    'plugin:nuxt/recommended',

  ],

  plugins: ['prettier'],

  // add your custom rules here

  rules: {

    'vue/no-unused-vars': 'off',

    'nuxt/no-unused-vars': 'off', // <--- This doesn't change anything

    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',

    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',

    'prefer-promise-reject-errors': 'off',

    'no-useless-return': 'off',

    'spaced-comment': 'off',

    'no-unused-vars': 'off',

    'vue/no-unused-components': 'off',

    // 'function-paren-newline': ['error', 'multiline'],

    'no-unreachable': 'off',

  },

}

[/code]

 

stylelint.config.js

[code]

module.exports = {

  extends: ['stylelint-config-standard', 'stylelint-config-prettier'],

  // add your custom config here

  // https://stylelint.io/user-guide/configuration

  rules: {

    'no-empty-source': null,

    'selector-pseudo-element-no-unknown': null,

    'block-no-empty': null,

    'declaration-empty-line-before': null,

    'no-descending-specificity': null,

    'at-rule-no-unknown': [

      true,

      {

        ignoreAtRules: ['function', 'if', 'each', 'include', 'mixin'],

      },

    ],

  },

[/code]

댓글 0개

등록된 댓글이 없습니다.

Menu