eslint-plugin-postcss-modules
eslint-plugin-postcss-modules copied to clipboard
I use to annotate in the less file, eslint will block and cannot be used
.eslintrc.js
module.exports = {
parser: '@babel/eslint-parser',
plugins: ['postcss-modules'],
settings: {
'postcss-modules': {
// 用于确定应该为 css-module 导出解析哪些文件。任何匹配 include 但不匹配 exclude 的文件都将被解析
include: '**/*.less',
// 用于确定不应为 css-module 导出解析哪些文件。任何匹配 include 但不匹配 exclude 的文件都将被解析
exclude: '**/node_modules/**/*',
},
},
rules: {
'postcss-modules/no-undef-class': 'error',
'postcss-modules/no-unused-class': 'error',
},
};
index.module.less
//.container {
// padding: 40px;
//}
I'm not sure I understand what the problem is you are running into, but, have you configured postcss to use the less syntax? See https://www.npmjs.com/package/postcss-less
He meant that your plugin crushes on comments (// comment). It works with the natively supported by css format tho (/* comment */)