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

.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]

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

위로 스크롤