Skip to content

Commit

Permalink
refactor: architecture (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Apr 27, 2024
1 parent f46d163 commit 8f5d86b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion .ecrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"exclude": [
"CHANGELOG.md",
"css.ts",
"pnpm-lock.yaml",
"README.md",
"regexps.ts"
Expand Down
9 changes: 7 additions & 2 deletions src/rules/css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { messages } from '../utils/messages.ts';
import { regex } from '../utils/regexps.ts';

const BLOCK = regex.bem.BLOCK_PATTERN;
const ELEMENT = regex.bem.ELEMENT_PATTERN;
const MODIFIER = regex.bem.MODIFIER_PATTERN;

const CSSRules = {
'at-rule-disallowed-list': ['debug'],
'color-named': 'never',
Expand All @@ -17,9 +22,9 @@ const CSSRules = {
'no-descending-specificity': null,
'no-unknown-animations': true,
'selector-class-pattern': [
`^${regex.bem.BLOCK_PATTERN}*${regex.bem.ELEMENT_PATTERN}?${regex.bem.MODIFIER_PATTERN}?$`,
`^${BLOCK}*${ELEMENT}?${MODIFIER}?$`,
{
message: 'Expected lowercase class name by BEM (block__element--modifier)',
message: messages.BEM_PATTERN,
},
],
'selector-max-combinators': 4,
Expand Down
5 changes: 5 additions & 0 deletions src/utils/messages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const messages = {
BEM_PATTERN: 'Expected lowercase class name by BEM (block__element--modifier)',
};

export { messages };

0 comments on commit 8f5d86b

Please sign in to comment.