ESLintλ μλ°μ€ν¬λ¦½νΈ μ½λμμ μ€λ₯λ₯Ό μ°Ύκ³ μ½λ μ€νμΌμ μ μ§νκΈ° μν λ°μ΄λ λꡬ μ€ νλμΈλ°μ.
μ΄ λꡬλ μ€μ νμΌμΈ .eslintrc.jsμ ν΅ν΄ κ·μΉμ ꡬμ±ν μ μμ΅λλ€.
μ΄ νμΌμ μΌλ°μ μΌλ‘ νλ‘μ νΈμ λ£¨νΈ λλ ν 리μ μμΉνλ©°, ESLintμ λμμ λ³κ²½νκ³ νλ‘μ νΈμ νμ§μ κ°μ νλ λ° μ€μν μν μ ν©λλ€.
.eslintrc.js νμΌμ μμ νλ €λ©΄, νλ‘μ νΈ λλ ν 리μμ ν΄λΉ νμΌμ μ΄μ΄μ μνλ λ³κ²½ μ¬νμ μννλ©΄ λ©λλ€. μλ₯Ό λ€μ΄, κ·μΉμ μΆκ°νκ±°λ μμ νκ±°λ κ΅¬μ± μ΅μ
μ λ³κ²½ν μ μμ΅λλ€. λ³κ²½ μ¬νμ μ μ₯νλ©΄ μ¦μ μ μ©λ©λλ€.
κ·Έλ¬λ νμΌμ μμ νκΈ° μ μ, νμΌμ λ΄μ©μ μ΄ν΄νλ κ²μ΄ μ€μν©λλ€. ESLint κ·μΉμ λ³κ²½ν λλ κ·μΉμ΄ μ΄λ»κ² λμνλμ§, ν΄λΉ λ³κ²½μ΄ μ½λ νμ§μ μ΄λ€ μν₯μ λ―ΈμΉ μ μλμ§ λ±μ κ³ λ €ν΄μΌ ν©λλ€. μ΄λ¬ν μ΄μ λ‘ μΌλΆ κ°λ°μλ€μ ESLintλ₯Ό μ¬μ©νλ κ²μ κΆμ₯νλ©°, μ½λ νμ§μ κ°μ νκΈ° μν λ
Έλ ₯μ κ²©λ €ν©λλ€. λ λμ μ½λλ₯Ό μμ±νκΈ° μν΄ ESLintλ₯Ό νμ©ν΄ 보μΈμ!
C:\Users\Administrator\Documents\23 lng_api\front\lngapi_frontend\src\views\FuturesView.vue
1:1 error Unexpected Unicode BOM (Byte Order Mark) unicode-bom
5:12 error Newline required at end of file but not found eol-last
β 2 problems (2 errors, 0 warnings)
2 errors and 0 warnings potentially fixable with the `--fix` option.
μ²μμ μ΄λ° μ€λ₯κ° λ μ, κ²°κ΅μλ eslint κΉμ§ μ€κ² λμλ€μ.
C:\Users\Administrator\Documents\23 lng_api\front\lngapi_frontend>npm install -g eslint
C:\Program Files\nodejs\eslint -> C:\Program Files\nodejs\node_modules\eslint\bin\eslint.js
npm WARN notsup Unsupported engine for eslint@8.38.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: eslint@8.38.0
npm WARN notsup Unsupported engine for @eslint-community/eslint-utils@4.4.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: @eslint-community/eslint-utils@4.4.0
npm WARN notsup Unsupported engine for eslint-scope@7.1.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: eslint-scope@7.1.1
npm WARN notsup Unsupported engine for @humanwhocodes/module-importer@1.0.1: wanted: {"node":">=12.22"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: @humanwhocodes/module-importer@1.0.1
npm WARN notsup Unsupported engine for eslint-visitor-keys@3.4.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})npm WARN notsup Not compatible with your version of node/npm: eslint-visitor-keys@3.4.0
npm WARN notsup Unsupported engine for espree@9.5.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: espree@9.5.1
npm WARN notsup Unsupported engine for @eslint/js@8.38.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: @eslint/js@8.38.0
npm WARN notsup Unsupported engine for @eslint/eslintrc@2.0.2: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"12.21.0","npm":"6.14.11"})
npm WARN notsup Not compatible with your version of node/npm: @eslint/eslintrc@2.0.2
npm
Config νμΌ μ€μ μ 보λ λ€μκ³Ό κ°μμ.
eslint --init
ν΄λΉ μ½λ μ€νν,
μ¬κΈ°μ μ λ μΈλ―Έμ½λ‘ (;) λ₯Ό νμ©νμ§ μκ³ , μ격νκ² μ½λ κ·μΉμ μ‘λ κΈ°λ³Έ μΈν μμ μ‘°κΈ μννλ μ€μ μ λ£μ΄μ£Όλλ‘ νκ² μ΅λλ€.
μ²μ μΈν μ λ€μκ³Ό κ°μμ.(default)
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-essential',
'standard'
],
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'vue'
],
rules: {
}
}
(λ³κ²½ ν)
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-essential',
'standard'
],
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'vue'
],
rules: {
"indent": [
"error",
4
],
"semi": [
"error",
"always"
],
"no-trailing-spaces": 0,
"keyword-spacing": 0,
"no-unused-vars": 1,
"no-multiple-empty-lines": 0,
"space-before-function-paren": 0,
"eol-last": 0
}
}
μ΄λ κ² μ€μ νκ² λλ©΄, μκ°λ³΄λ€ μμμ΄ λ§μ μλ¬κ° λ°μνλ€μ.
κ·Έλμ λ€μ, νμ¬ λ΄ indent λ°©μμ΄ 2μ¬μ λ€μ μλ¬κ° λ¨κ³ μκΈΈλ , μ€μ νμΌμ λ°κΎΈκ³ , μμ§ μ λ μΈλ―Έμ½λ‘ μ¬μ©μ΄ μ΅μνμ§λ μμμ, νμ κ²½κ³ μΈ "errors" λ₯Ό 1 λ‘ λ³κ²½νμ΅λλ€. γ γ
κ·Έλμ μ΅μ’ μ€μ μ.
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:vue/vue3-essential',
'standard'
],
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: [
'vue'
],
rules: {
"indent": [
"error",
2
],
"semi": [
1,
"always"
],
"no-trailing-spaces": 0,
"keyword-spacing": 0,
"no-unused-vars": 1,
"no-multiple-empty-lines": 0,
"space-before-function-paren": 0,
"eol-last": 0
}
}
vue standart μ μ± μ μ°Έκ³ νμλ €λ©΄, κ΄λ ¨ λΈλ‘κ·Έ κΈ μ°Έκ³ νμΈμ.
https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=1ilsang&logNo=221337351543
μλμΌλ‘ eslintλ₯Ό μ΄μ©ν΄μ, μ½λμ μλ¬λ₯Ό κ³ μΉκ³ μΆμλ°, μ€μ νλ λ°©λ²μ λ€μκ³Ό κ°μ΅λλ€.
μ΄νμ μΈν μ ν΄λΉ λΈλ‘κ·Έ κΈμ μ°Έκ³ νμ΅λλ€.
https://mkonji23.tistory.com/21
μ΄μΈμ μ’μ μΈμ¬μ΄νΈλ₯Ό μ€ λΈλ‘κ·Έ
'ποΈμννΈμ¨μ΄ > πVue' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[Vue.js] μ‘°κ±΄λΆ λ λλ§κ³Ό λ²νΌ νμ±ννκΈ° (0) | 2022.12.12 |
---|---|
[Vue.js] props μ΄μ©νκΈ° (1) | 2022.12.08 |
npx, npmμ μ°¨μ΄μ vscode μ€ν λ°©λ² (0) | 2022.12.02 |
[Vue.js]νΉμ λ°μ΄ν°λ€μ κ°λ€μ νμ΄λΌμ΄ν ν μλ μμκΉ? (0) | 2022.12.01 |