Skip to content

Commit

Permalink
feat: remove style order
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed May 13, 2024
1 parent cada56d commit 4c5dcfa
Show file tree
Hide file tree
Showing 15 changed files with 285 additions and 587 deletions.
6 changes: 5 additions & 1 deletion .best-shot/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export const config = {
'postcss-styl': 'node-commonjs postcss-styl',
// 'write-file-atomic': 'node-commonjs write-file-atomic',
eslint: 'module eslint',
stylelint: 'node-commonjs stylelint',
stylelint: 'module stylelint',
sugarss: 'node-commonjs sugarss',
'stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js':
'node-commonjs stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js',
'stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js':
'node-commonjs stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js',
},
};
2 changes: 0 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
enable-pre-post-scripts = true
shamefully-hoist = true
node-linker = hoisted
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ A code refactoring tool, fixing what `eslint/stylelint` shouldn't care about, wh
- Handle text case from `css/scss/less`
- Remove vendor prefix from `css/scss/less`
- Handle whitespace, empty line between code
- Sort `css/scss/less` properties
- Sort `html/htm` attributes
- Sort `jsx/tsx` props
- Sort `tsx/ts/mts/cts/jsx/js/mjs/cjs` class members
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/handle-config/transform.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import micromatch from 'micromatch';
import { traverse } from 'object-traversal';
import sortAll from 'sort-keys';

import { orders, root } from './config.js';
import { orders, root } from './config.mjs';
import { sortBy, sortKeys } from './utils.mjs';

const patterns = Object.keys(orders).filter(
Expand Down
3 changes: 0 additions & 3 deletions lib/handle-style/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import stylelint from 'stylelint';

import { GarouError } from '../utils/fs.mjs';

import { pluginOrder, ruleOrder } from './order.mjs';
import { pluginOther, ruleOther, vendors } from './other.mjs';
import { pluginScss, ruleScss } from './scss.mjs';

Expand All @@ -18,12 +17,10 @@ const config = {
reportNeedlessDisables: false,
reportInvalidScopeDisables: false,
pluginFunctions: {
...pluginOrder,
...pluginScss,
...pluginOther,
},
rules: {
...ruleOrder,
...ruleOther,
},
overrides: [
Expand Down
307 changes: 0 additions & 307 deletions lib/handle-style/order.mjs

This file was deleted.

6 changes: 0 additions & 6 deletions lib/handle-style/scss.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import s0 from 'stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js';
import s1 from 'stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js';
import s2 from 'stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js';
import s3 from 'stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js';

export const pluginScss = {
'scss/at-mixin-argumentless-call-parentheses': s0,
'scss/at-rule-conditional-no-parentheses': s1,
'scss/dollar-variable-empty-line-before': s2,
'scss/double-slash-comment-empty-line-before': s3,
};

export const ruleScss = {
'scss/at-mixin-argumentless-call-parentheses': 'always',
'scss/at-rule-conditional-no-parentheses': true,
'scss/dollar-variable-empty-line-before': [
'always',
{
Expand Down
Loading

0 comments on commit 4c5dcfa

Please sign in to comment.