You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-1Lines changed: 58 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,9 @@ List of 300 VueJS Interview Questions
132
132
|123|[How to create functional components using vue loader?](#how-to-create-functional-components-using-vue-loader)|
133
133
|124|[How do you access global properties of functional components?](#how-do-you-access-global-properties-of-functional-components)|
134
134
|125|[How do you perform testing in vuejs?](#how-do-you-perform-testing-in-vuejs)|
135
+
|126|[How do you apply linting for css?](#how-do-you-apply-linting-for-css)|
136
+
|127|[How do you use eslint plugin?](#how-do-you-use-eslint-plugin)|
137
+
|128|[What is the purpose of eslint loader?](#what-is-the-purpose-of-eslint-loader)|
135
138
136
139
1.### What is VueJS?
137
140
**Vue.js** is an open-source, progressive Javascript framework for building user interfaces that aim to be incrementally adoptable. The core library of VueJS is focused on the `view layer` only, and is easy to pick up and integrate with other libraries or existing projects.
@@ -2314,4 +2317,58 @@ List of 300 VueJS Interview Questions
2314
2317
125. ### How do you perform testing in vuejs?
2315
2318
You can perform testing in two ways,
2316
2319
1. ** Using vue-cli:** It offers pre-configured unit testing and e2e testing setups
2317
-
2. ** Manual setup:** You can manually setting up unit tests for *.vue files using either mocha-webpack or jest
2320
+
2. ** Manual setup:** You can manually setting up unit tests for *.vue files using either mocha-webpack or jest
2321
+
126. ### How do you apply linting for css?
2322
+
The stylelint linter supports linting style parts of Vue single file components. You can run linter on particular vue file as below
2323
+
```javascript
2324
+
stylelint MyComponent.vue
2325
+
```
2326
+
Other option is configuring stylelint-webpack-plugin in webpack. It can be configured as a dev dependency.
The official `eslint-plugin-vue` supports linting both the template and script parts of Vue single file components. You can configure plugin in your ESLint config,
2341
+
```javascript
2342
+
// .eslintrc.js
2343
+
module.exports = {
2344
+
extends: [
2345
+
"plugin:vue/essential"
2346
+
]
2347
+
}
2348
+
```
2349
+
You can run linter on particular component as below,
2350
+
```javascript
2351
+
eslint --ext js,vue MyComponent.vue
2352
+
```
2353
+
128. ### What is the purpose of eslint loader?
2354
+
You can use `eslint-loader` for *.vue files in order to automatically linted on save during development. It can be installed as npm module,
0 commit comments