swissquote / crafty

The task runner that binds them all
https://swissquote.github.io/crafty/
Apache License 2.0
30 stars 12 forks source link

Pre-commit hook failing on x-class selector & :local pseudo-class #2275

Closed asiuse closed 7 months ago

asiuse commented 8 months ago

Example, pre-commit hook fails with x-class selector pattern:

Expected ".t-dark" to match pattern "/^[a-z][a-zA-Z0-9]+$/"

Another example, pre-commit hook fails with :local pseudo-class selector:

Unexpected unknown pseudo-class selector ":local"

Example SCSS:

:global .t-dark {
    :local .CustomDropdown .Switcher {
        color: var(--color-text);
    }
}

Errors:

Error: Invalid class or id selector syntax
    at transform (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:198:1)
    at /home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:79:1
    at Array.map (<anonymous>)
    at transform (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:79:1)
    at /home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:128:1
    at Array.map (<anonymous>)
    at transform (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:128:1)
    at /home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:79:1
    at Array.map (<anonymous>)
    at transform (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:79:1)
    at /home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:54:1
    at Array.map (<anonymous>)
    at transform (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:46:1)
    at Processor.func (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:238:1)
    at localizeNode (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:239:1)
    at /home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:511:1
    at Object.Once (/home/asiuse/workspace/preferences-trading-plugin/server-war/src/main/frontend/node_modules/@swissquote/crafty-preset-postcss/dist/webpack:/node_modules/postcss-modules-local-by-default/src/index.js:501:1)
onigoetz commented 7 months ago

Released Released in https://github.com/swissquote/crafty/releases/tag/v1.25.0