希望有人能帮我解决一个奇怪的bug/问题,我一直有与手写+github/超级链接。我还在回购中添加了一个问题,因为我认为我已经尝试了很多事情,它似乎是一个错误,但也许这是一个配置问题,在我的一端。
我已经尝试将我们的多个项目迁移到V14上已经有一段时间了,但是我似乎无法让它适应我们的Github操作工作流。它以前在V13上很有效。
在本地,当运行像:npm run stylelint这样的命令时,它会很好地工作,它会返回预期的错误,但是当运行Github的超级链接操作时,结果似乎忽略了我们的自定义规则,并抱怨它需要一个customSyntax。我增加了那些作为测试,但到目前为止没有运气。
我已经建立了一个带有PR的演示存储库,它可以触发样式表来模拟这个问题:focus=true
需要什么Stylelint配置才能重现该bug?
{
"extends": ["stylelint-config-standard-scss"],
"customSyntax": "postcss-scss",
"rules": {
"selector-class-pattern": null
}
}也尝试了没有"customSyntax“,但它似乎没有改变任何事情。
我的超级链接配置:
name: PR Linter
#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [main]
# Remove the line above to run when pushing to master
###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest
##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: docker://github/super-linter:v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_CSS: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}你是怎么管理斯泰林的?
运行槽github /超级链接作为github动作
你用的是哪种版本的施泰林特?
“^14.2.0”
你以为会发生什么?
我希望我的自定义规则能够应用,而Expected class selector to be kebab-case selector-class-pattern不会出现类似于我在本地运行的样式表输出的方式。
到底发生了什么?
如果我运行npm run stylelint,就会得到:
> lintertest@0.1.0 stylelint
> stylelint "**/*.scss"
scss/test.scss
4:3 ✖ Expected shorthand property "flex-flow" declaration-block-no-redundant-longhand-properties但是,当它在GitHub超级链接中运行时,相同的命令提供给我:
2022-01-14 14:36:24 [ERROR] Found errors in [stylelint] linter!
2022-01-14 14:36:24 [ERROR] Error code: 2. Command output:
------
/github/workspace/scss/test.scss: When linting something other than CSS, you should install an appropriate syntax, e.g. "postcss-scss", and use the "customSyntax" option
scss/test.scss
1:1 ✖ Expected class selector to be kebab-case selector-class-pattern
5:1 ✖ Expected class selector to be kebab-case selector-class-pattern
8:3 ✖ Expected shorthand property "flex-flow" declaration-block-no-redundant-longhand-properties
------希望任何人在使用SCSS皮棉槽针和github/ stylelint时都有类似的行为。
https://stackoverflow.com/questions/70712920
复制相似问题