matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

TypeError: repeat-string expects a string #180

Open paazmaya opened 7 years ago

paazmaya commented 7 years ago

stylefmt: 4.2.3 Node.js: 6.3.1 OS: macOS

Input CSS:

@charset 'utf-8';

@font-face {
  font-family: 'VarelaRound';
  src: url('varela-round/varelaround-regular-webfont.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

Command:

stylefmt font-faces.css

Result:

TypeError: repeat-string expects a string.
    at repeat (/usr/local/lib/node_modules/stylefmt/node_modules/repeat-string/index.js:43:11)
    at getIndent (/usr/local/lib/node_modules/stylefmt/lib/getIndent.js:8:21)
    at /usr/local/lib/node_modules/stylefmt/lib/formatAtRules.js:31:23
    at /usr/local/lib/node_modules/stylefmt/node_modules/postcss/lib/container.js:312:28
    at /usr/local/lib/node_modules/stylefmt/node_modules/postcss/lib/container.js:164:26
    at Root.each (/usr/local/lib/node_modules/stylefmt/node_modules/postcss/lib/container.js:130:22)
    at Root.walk (/usr/local/lib/node_modules/stylefmt/node_modules/postcss/lib/container.js:163:21)
    at Root.walkAtRules (/usr/local/lib/node_modules/stylefmt/node_modules/postcss/lib/container.js:310:25)
    at formatAtRules (/usr/local/lib/node_modules/stylefmt/lib/formatAtRules.js:13:8)
    at /usr/local/lib/node_modules/stylefmt/index.js:18:7
paazmaya commented 7 years ago

When configuration is specified:

stylefmt -c stylelint-rule.js font-faces.css

and the contents of stylelint-rule.js are:

module.exports = {
  'rules': {
    'declaration-block-properties-order': 'alphabetical'
  }
};

The CSS file is unchanged.

paazmaya commented 7 years ago

In case the expected configuration file is not found, complain and stop processing.