Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown word (CssSyntaxError)stylelint(CssSyntaxError) #35

Closed
bikashd003 opened this issue Mar 24, 2024 · 18 comments
Closed

Unknown word (CssSyntaxError)stylelint(CssSyntaxError) #35

bikashd003 opened this issue Mar 24, 2024 · 18 comments

Comments

@bikashd003
Copy link

a new issue occurs on every code file, whether it is simple boilerplate code or complex code, the issue is
"Unknown word (CssSyntaxError)stylelint(CssSyntaxError)"

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

Thank you for your feedback. In version 0.57, I upgraded the internal stylelint version to 15 in the extension and made it compatible with 16, so there may be some differences. I suggest you use the useLocal option, using the stylelint in your project. If you don't want to use the useLocal option, you can exclude these erroneous files in your stylelint configuration file.

@BohdanYavorskyi
Copy link

@hex-ci it just doesn't make any sense. All jsx, tsx files are scanned (not styles) and error. Please take a look at what can break it and try to fix. Thanks in advance.

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

@hex-ci it just doesn't make any sense. All jsx, tsx files are scanned (not styles) and error. Please take a look at what can break it and try to fix. Thanks in advance.

Please use useLocal option.

@BohdanYavorskyi
Copy link

@hex-ci it just doesn't make any sense. All jsx, tsx files are scanned (not styles) and error. Please take a look at what can break it and try to fix. Thanks in advance.

Please use useLocal option.

if I don't have local configuration. Where this one should be added?

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

@hex-ci it just doesn't make any sense. All jsx, tsx files are scanned (not styles) and error. Please take a look at what can break it and try to fix. Thanks in advance.

Please use useLocal option.

if I don't have local configuration. Where this one should be added?

The reason for these problems is that I upgraded the version of stylelint inside the extension. Normally, you should use the stylelint in node_modules in the project, and it is best not to use the stylelint inside the extension. Because the extension can only have a fixed version of stylelint built-in, it may not be suitable for everyone.

If I were to go without any local stylelint, then I would have to downgrade the stylelint inside the extension, but stylelint 16 and later versions will become increasingly incompatible and the problem will never go away.

Therefore, the best solution is to use local stylelint.

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

You can't use very old stylelint forever, which is also bad for development.

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

In addition, you can also exclude files that do not require lint by configuring the ignoreFiles option of stylelint.config.js, for example: ignoreFiles: ['**/*.{js,cjs,mjs,ts,tsx,svg,md}' , 'dist/**', '.*', 'node_modules/.*/**']

For files such as vue and html, you may also need a configuration similar to this in the stylelint.config.js file:

overrides: [
  {
    files: ['**/*.{vue,html}'],
    customSyntax: 'postcss-html',
  },
],

You need to install postcss-html via npm.

@hex-ci
Copy link
Owner

hex-ci commented Mar 25, 2024

@hex-ci it just doesn't make any sense. All jsx, tsx files are scanned (not styles) and error. Please take a look at what can break it and try to fix. Thanks in advance.

Please use useLocal option.

if I don't have local configuration. Where this one should be added?

In fact, the usage is similar to eslint. If you have not initialized a project through npm init, then you should initialize a project first. If the project already exists, then you should npm i -D stylelint to install a stylelint, and then just like a normal front-end project Just use stylelint. If useLocal is true, the stylelint installed in your project will be used.

@vinit-poojary
Copy link

I'm getting the same error for both TS and TSX files. Should I ignore them?

@hex-ci
Copy link
Owner

hex-ci commented Mar 27, 2024

I'm getting the same error for both TS and TSX files. Should I ignore them?

yes,ignore them. OR use useLocal option, then install stylelint v13

@time4nothing
Copy link

I am also having this problem since updating to stylelint-plus v0.57.0. Problem goes away if I install the previous version v0.56.6. Will this bug be fixed soon?

@sanket95droid
Copy link

not able to downgrade to stylelint v13 please help?

@hex-ci
Copy link
Owner

hex-ci commented Mar 29, 2024

not able to downgrade to stylelint v13 please help?

Downgrading is not a good idea. Because the latest version of stylelint is now v16, v17 may come soon. We can't always use a very old version of stylelint. If you want to use an old version of stylelint, please turn on the useLocal option to use stylelint in your own project directory.

@hex-ci
Copy link
Owner

hex-ci commented Mar 29, 2024

I am also having this problem since updating to stylelint-plus v0.57.0. Problem goes away if I install the previous version v0.56.6. Will this bug be fixed soon?

Downgrading is not a good idea. Because the latest version of stylelint is now v16, v17 may come soon. We can't always use a very old version of stylelint. If you want to use an old version of stylelint, please turn on the useLocal option to use stylelint in your own project directory.

@hex-ci hex-ci closed this as completed Apr 1, 2024
@sanket95droid
Copy link

sanket95droid commented Apr 2, 2024

I am also having this problem since updating to stylelint-plus v0.57.0. Problem goes away if I install the previous version v0.56.6. Will this bug be fixed soon?

Downgrading is not a good idea. Because the latest version of stylelint is now v16, v17 may come soon. We can't always use a very old version of stylelint. If you want to use an old version of stylelint, please turn on the useLocal option to use stylelint in your own project directory.

what actually is useLocal and where to use it, can you provide reference to any docs? I found it in stylelint-plus..
Thank you

@hex-ci
Copy link
Owner

hex-ci commented Apr 2, 2024

I am also having this problem since updating to stylelint-plus v0.57.0. Problem goes away if I install the previous version v0.56.6. Will this bug be fixed soon?

Downgrading is not a good idea. Because the latest version of stylelint is now v16, v17 may come soon. We can't always use a very old version of stylelint. If you want to use an old version of stylelint, please turn on the useLocal option to use stylelint in your own project directory.

what actually is useLocal and where to use it, can you provide reference to any docs? I found it in stylelint-plus.. Thank you

Install stylelint v13 in your project root directory: npm i -D stylelint@13, then the useLocal option will take effect, which should have the same effect as the old version of stylelint-plus extension.

@le0nik
Copy link

le0nik commented Apr 22, 2024

I have stylelint@14 and useLocal is enabled and I'm still getting this error.

@hex-ci
Copy link
Owner

hex-ci commented Apr 23, 2024

I have stylelint@14 and useLocal is enabled and I'm still getting this error.

You must use stylelint v13, or use v14 or higher and add the ignore configuration, because stylelint v14 and higher does this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants