Skip to content

Commit

Permalink
refactor(ts): add only export default (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nikkeyl authored Feb 26, 2024
1 parent f9177b2 commit 3f37eab
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 32 deletions.
4 changes: 1 addition & 3 deletions src/creators/at-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
* will have a block of nested rules or declarations inside it. If `hasBlock`
* is `true`, it means that the at-rule will have a block.
*/
const createAtRule = async (name: string, hasBlock: boolean) => ({
export default async (name: string, hasBlock: boolean) => ({
name,
hasBlock,
type: 'at-rule',
});

export default createAtRule;
4 changes: 1 addition & 3 deletions src/creators/logical-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
* with the specified `groupName`. These properties can be of any type or
* structure, depending on your specific use case.
*/
const createLogicalGroup = async (groupName: string, properties: any[]) => ({
export default async (groupName: string, properties: any[]) => ({
groupName,
properties,
emptyLineBefore: 'always',
noEmptyLineBetween: true,
order: 'flexible',
});

export default createLogicalGroup;
4 changes: 1 addition & 3 deletions src/creators/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
* function is a string that
* represents the CSS selector for which a rule is being created.
*/
const createRule = async (selector: string) => ({
export default async (selector: string) => ({
selector: `&${selector}`,
type: 'rule',
});

export default createRule;
4 changes: 1 addition & 3 deletions src/properties/deprecated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const deprecated = {
export default {
property: {
float: 'float',
clear: 'clear',
Expand Down Expand Up @@ -84,5 +84,3 @@ const deprecated = {
},
},
};

export default deprecated;
4 changes: 1 addition & 3 deletions src/properties/experimental.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const experimental = {
export default {
pseudo: {
element: {
targetText: '::target-text',
Expand Down Expand Up @@ -74,5 +74,3 @@ const experimental = {
},
},
};

export default experimental;
4 changes: 1 addition & 3 deletions src/properties/non-standard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const nonStandard = {
export default {
pseudo: {
element: {
webkit: {
Expand Down Expand Up @@ -70,5 +70,3 @@ const nonStandard = {
zoom: 'zoom',
},
};

export default nonStandard;
4 changes: 1 addition & 3 deletions src/properties/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const deprecatedProperty = deprecated.property;
const experimentalProperty = experimental.property;
const nonStandardProperty = nonStandard.property;

const propertiesOrder = {
export default {
'order/order': [
'custom-properties',
'dollar-variables',
Expand Down Expand Up @@ -675,5 +675,3 @@ const propertiesOrder = {
},
],
};

export default propertiesOrder;
4 changes: 1 addition & 3 deletions src/rules/css.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import REGEXP from '../utils/regexps.ts';

const CSSRules = {
export default {
'at-rule-disallowed-list': ['debug'],
'color-named': 'never',
'declaration-empty-line-before': null,

Check warning on line 6 in src/rules/css.ts

View workflow job for this annotation

GitHub Actions / Lint

Use `undefined` instead of `null`

Check warning on line 6 in src/rules/css.ts

View workflow job for this annotation

GitHub Actions / Lint

Use `undefined` instead of `null`
Expand Down Expand Up @@ -35,5 +35,3 @@ const CSSRules = {
},
],
};

export default CSSRules;
5 changes: 2 additions & 3 deletions src/rules/scss.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const namedArguments = ['always', { ignore: ['single-argument'] }];
const SCSSRules = {

export default {
'scss/at-each-key-value-single-line': true,
'scss/at-function-named-arguments': namedArguments,
'scss/at-mixin-named-arguments': namedArguments,
Expand All @@ -19,5 +20,3 @@ const SCSSRules = {
'scss/property-no-unknown': true,
'scss/selector-no-redundant-nesting-selector': true,
};

export default SCSSRules;
4 changes: 1 addition & 3 deletions src/utils/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import propertiesOrder from '../properties/order.ts';

const plugins = {
export default {
'gamut/color-no-out-gamut-range': true,
'plugin/stylelint-group-selectors': true,
'plugin/declaration-block-no-ignored-properties': true,
Expand All @@ -21,5 +21,3 @@ const plugins = {
'plugin/use-logical-units': true,
...propertiesOrder,
};

export default plugins;
5 changes: 3 additions & 2 deletions src/utils/regexps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const ATTRIBUTE = '?\\[(.*)\\]';
const CLASS = '?\\.(.*)';
const MODIFIER = '--';
const ELEMENT = '__';
const REGEXP = {

export default {
BEM: {
BLOCK: `[a-z]${PATTERN}*(-${PATTERN}+)`,
ELEMENT: `(${ELEMENT}${PATTERN}+(-${PATTERN}+)*)`,
Expand All @@ -23,4 +24,4 @@ const REGEXP = {
},
};

export default REGEXP;
// export default REGEXP;

0 comments on commit 3f37eab

Please sign in to comment.