[postcss-linaria] Allow for alias of `css` in config
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- tooling
调研方向
阅读 packages/postcss-linaria/src/parse.ts,尤其是相关的 css/styled 匹配逻辑,并检查插件当前如何接收配置。确认可以为两种方法配置别名,并确认 stylelint 会标记通过这些别名访问到的模板字面量中的声明。
由索引模型根据 Issue 内容生成。
描述
Describe the enhancement
Supply the ability to declare aliases for css and styled when running stylelint analysis for projects that export those methods from linaria with a different name.
Motivation
I'm using atomic styles in a personal project. I recently added stylelint with property-disallowed-list to flag uses of margin and padding, (to prompt using margin-left instead, etc) and it wasn't working... at all.
After a day of digging, it turned out the reason was I had abstracted the use of linaria out to a local import. And since I was needing to apply global styles for a component library, to differentiate css from core and atomic, I had done the following:
// lib/css
export { css as csa, styled } from '@linaria/atomic';
export { css } from '@linaria/core';
and
// some/component.styles.ts
import { csa } from '@lib/css';
...
csa`{
margin-left: 10px;
}`
Because postcss-linaria looks specifically for css and styled the string literals weren't being flagged.
Possible implementations
Allow the ability to configure the syntax with aliases to each named method:
alias: {
css: 'csa',
styled: 'linariaStyled',
}
Related Issues
None I could find.
- 主要语言
- TypeScript
- 星标
- 12.4k
- 派生
- 413
- 平均合并
- 1 天 49 分钟
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/linaria 的其他 Issue
-
enhancement: proposal 💬 needs: triage 🏷
难度 4/5 3-5 天 新手友好度 45/100
callstack/linaria#1460 · 4 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
feature: proposal 💬 needs: triage 🏷
难度 5/5 一周以上 新手友好度 35/100
callstack/linaria#1427 · 3 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
enhancement: proposal 💬 needs: triage 🏷
难度 3/5 1-2 天 新手友好度 35/100
callstack/linaria#1417 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug report 🦗 bundler: webpack 📦 needs: complete repro 🖥️
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
feature: proposal 💬 needs: triage 🏷
难度 5/5 一周以上 新手友好度 25/100
callstack/linaria#1410 · 1 个 reaction ·
维护者通常 1 天内回复
查看 callstack/linaria 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
oxidecomputer/skepsis#102 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
voidzero-dev/void#677 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
kunchenguid/gh-axi#247 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
lidge-jun/opencodex#8101 · 2 条评论 ·
维护者通常 1 天内回复