Comments (6)
No, what I need is to exclude.
I tried "exclude: ['uno.css']" and it didn't work
Now it works, thank you!
from vite-plugin-stylelint.
Can you please provide a minimal reproduction?
from vite-plugin-stylelint.
---init---
npm create vite@latest my-vue-app -- --template vue-ts
cd my-vue-app && npm install
npm install --save-dev stylelint stylelint-config-standard vite-plugin-stylelint unocss
---vite.config.ts---
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Unocss from 'unocss/vite'
import StylelintPlugin from 'vite-plugin-stylelint'
export default defineConfig({
plugins: [
vue(),
StylelintPlugin(),
Unocss()
]
})
---.stylelintrc.json---
{
"extends": "stylelint-config-standard",
"ignoreFiles": ["**/*.vue"]
}
---main.ts---
import 'uno.css'
from vite-plugin-stylelint.
I don't know how to lint virtual files like uno.css
or __uno.css
because they actully not exist. One solution is to set exclude
.
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import Unocss from "unocss/vite";
import StylelintPlugin from "vite-plugin-stylelint";
export default defineConfig({
plugins: [
vue(),
StylelintPlugin({
exclude: [/node_modules/, /uno\.css/],
}),
Unocss(),
],
});
PR welcome if you have better solution.
EDIT: IMO virtual files should be linted.
from vite-plugin-stylelint.
I think I need to pin this. I actually know little about virtual modules. 😅
from vite-plugin-stylelint.
v2.3.0 released. The plugin ignores virtual modules by default now. Open a new issue if someone is still facing this problem.
from vite-plugin-stylelint.
Related Issues (20)
- Missing typescript definition for `fix` option HOT 3
- Vite 3.0.0 support HOT 3
- Error: Dynamic require of "stylelint" is not supported HOT 7
- The plugin doesn't report the source of synax error HOT 9
- Wrong `StylelintPluginOptions` type HOT 3
- No filename or line number? HOT 7
- V4 roadmap
- SyntaxError: Named export 'formatters' not found HOT 5
- Lint some files twice
- nuxt 3 vs vite-plugin-stylelint 4.0.0 HOT 3
- Error: Dynamic require of "tty" is not supported HOT 9
- Switch to rollup and named export HOT 3
- Better emit errors / warings handling
- Doesnt seem to work after buildStart HOT 2
- Update prettier to v3 HOT 1
- Passing `context` to `lintFiles` when enable `chokidar` breaks the build
- Update package for rollup v4 support HOT 2
- Vite 5 semver in `peerDependencies` HOT 1
- `output` is deprecated. Use `report` or `code` instead. HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-stylelint.