temel ayarlar ile ilgili bir dosya oluştur. adını jsconfig.json yap. aşağıdaki kodu yaz.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": [ "resources/js/*" ] }, "jsx": "preserve", }, "exclude": [ "node_modules", "public" ] } |
bir önceki sayfada import MainLayout from ‘@/Pages/Layouts/MainLayout.vue’ kodunu eklemiştiktik ya bu @ işareti verisini buradan çekecek.
npm install –save-dev eslint eslint-plugin-vue çalıştır.
yine ana klasöre .eslintrc.js dosyası oluştur.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
module.exports = { extends: ['eslint:recommended', 'plugin:vue/vue3-recommended'], parserOptions: { ecmaVersion: 2020, sourceType: 'module', }, env: { amd: true, browser: true, es6: true, }, rules: { indent: ['error', 2], quotes: ['warn', 'single'], semi: ['warn', 'never'], 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }], 'comma-dangle': ['warn', 'always-multiline'], 'vue/multi-word-component-names': 'off', 'vue/max-attributes-per-line': 'off', 'vue/no-v-html': 'off', 'vue/require-default-prop': 'off', 'vue/singleline-html-element-content-newline': 'off', 'vue/html-self-closing': [ 'warn', { html: { void: 'always', normal: 'always', component: 'always', }, }, ], 'vue/no-v-text-v-html-on-component': 'off', }, } |
package.json dosyasını aç. script dizisinin içine
“fix:eslint”: “eslint –ext .js, .vue resources/js/ –fix”
ekle. sonra npm run fix:eslint ve npm run build sırasıyla bu kodları çalıştır. tamamdır.