Comments (4)
Yeah, I couldn't get postcss-bem-linter
working either and I'm using postcss-import
to process import
rules as well. I didn't realize that the @define
had to be on the first line in a separate file, but that makes sense otherwise it would be difficult to tell when to stop linting for that component.
I'm not quite sure how to fix this just yet. I think my assumption to use app.css
or {app-name}.css
is too strict and was a naive first implementation to quickly get postcss working with ember-cli.
I'll need to think about this. I don't want to break how the addon currently works, but this definitely needs to be addressed.
from ember-cli-postcss.
I'm not quite sure how to fix this just yet. I think my assumption to use app.css or {app-name}.css is too strict and was a naive first implementation to quickly get postcss working with ember-cli.
I'd say it is a good default (except for {app-name}.css, which ember-cli does not accept as an entry point for me, v0.2.3).
Maybe it would make sense to allow for people to define their own array of entry points (with globbing), and default to all css in the app/styles
folder, but not the folders below it (which are typically used for partials)? You could also allow people to explicitly define partials, and then default to folders below app/styles
.
I'd almost think that you'd need different stages in the preprocessing for the types of uses that I've encountered):
- process all css (and do stuff like linting all css with bem-linter)
- process only the entry points and build
Maybe a key in the plugin array besides module
, options
could define whether the plugin is to be used for step 1 or step 2?
from ember-cli-postcss.
Or, you could fork this plugin to use ember-cli's postprocessTree
hook, and dedicate that fork exclusively to linting (since that's what the postprocessTree
hook is for). That would separate the two use-cases cleanly.
Not sure whether postprocessTree
can pass all files separately though, but if it doesn't, I'd say that that's an upstream issue to be fixed in ember-cli.
from ember-cli-postcss.
I was able to solve this issue and get BEM linting to work by passing plugins to the postcss-import
plugin, which will run the plugins on each file it imports. I think this is likely a preferable solution to using the postprocessTree
hook as everything will run in one place.
The config can look something like this:
postcssOptions.plugins = [
{
module: require('postcss-import'),
options: {
glob: true,
plugins: [
require('postcss-nesting'),
require('postcss-nested'),
require('postcss-bem-linter'),
require('postcss-browser-reporter'),
require('postcss-reporter')({
clearMessages: true,
noPlugin: true
})
]
}
},
<more plugins>
}
]
I'm going to close this issue since it's possible to setup linting. Please reopen the issue if you're unable to get this working in your projects.
from ember-cli-postcss.
Related Issues (20)
- Embroider and postcss-import can't find file in node_modules? HOT 1
- Does not work with postcss 8 HOT 4
- apps, addons, and tailwind specificity HOT 3
- Infinite loop with postcss-color-hex-alpha HOT 2
- Embroider compatibility issue (filter) HOT 2
- Cannot use SCSS in version 7 HOT 10
- How do you run css compilation when templates are updated? HOT 23
- Ember canary error - Uncaught ReferenceError: Ember is not defined HOT 3
- Vulnerability in merge package before 2.1.1 HOT 1
- Deprecation warnings with Ember 3.27 HOT 14
- Addon using @tailwindcss/jit: ENOENT: no such file or directory, stat 'assets/vendor.css' HOT 1
- `yarn outdated` is Confusing HOT 2
- Cannot use `cssnano` in version 7 HOT 6
- ember-cli-postcss v7.1.0 has a breaking change as it's requires Node.js 14 now HOT 5
- ChainAlert: npm package release (7.2.0) has no matching tag in this repo
- Node 12 dropped too early? HOT 1
- Filter deprecation warnings HOT 1
- How do I add postcss-nested to configuration? HOT 1
- [Bug]: Conflicting with ember-cli-sass HOT 2
- how to apply a specific postcss plugin to only a specific set of files
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 ember-cli-postcss.