Git Product home page Git Product logo

sass-lint-auto-fix's Introduction

Sass Lint Auto Fix

NPM Version npm Build Status dependencies Status Coverage Status semantic-release

Description

This package serves as a complement to sass-lint, giving you the ability to resolve simple linting issues with an easy to use command line interface. Issues are resolved by parsing the s(a|c)ss as an ast, traversing through it, and modifying certain branches to be in accordance to the .sass-lint.yml standards.

Getting Started

Usage

  Usage: sass-lint-auto-fix "<pattern>" [options]

  Options:

    -V, --version                    output the version number
    -c, --config <path>              custom config path (e.g /path/to/.sass-lint-auto-fix.yml)
    --config-sass-lint <path>        custom sass lint config path (e.g /path/to/.sass-lint.yml
    -s, --silent                     runs in silent mode
    -d, --debug                      runs in debug mode
    -h, --help                       output usage information

Installing as a dependency

To begin install the package as a dev-dependency for your repository.

npm install --save-dev sass-lint-auto-fix

Modify package.json scripts to include lint:fix

{
  ...,
  "scripts": {
    "lint": "sass-lint -v",
    "lint:fix": "sass-lint-auto-fix"
  }
}

lint:fix works really well with husky, which allows you to run commands on hooks that fire when running git commands

Add the following to your package.json

{
  "husky": {
    "hooks": {
      "pre-commit": "yarn lint:fix && yarn lint",
      "pre-push": "yarn test",
      "...": "..."
    }
  }
}

Installing globally

npm install -g sass-lint-auto-fix

Configuration

Configuration can be provided through as either json, yml, or js.

The generic structure of the configuration file you would provide would look something like this:

interface Ruleset {
  [ruleName: string]: number | { [ruleOption: string]: any };
}

interface ConfigOpts {
  logger: Logger;
  slRules?: any;
  slConfig?: any;
  files: {
    include: string;
    ignore?: string;
  };
  syntax: {
    include: (keyof typeof ValidFileType)[];
  };
  resolvers: Ruleset;
  options: {
    optOut: boolean;
  };
}

An example of this in yaml.

files:
  include: "**/*.s+(a|c)ss"
  ignore:
    - node_modules/**
syntax:
    include:
      - scss
      - sass
resolvers:
  property-sort-order: 1
  attribute-quotes: 1
  border-zero: 1
  no-color-keywords: 1
  no-css-comments: 0
  no-important: 0
  no-trailing-zero: 1
  space-after-bang: 1
  space-before-bang: 1
  space-after-colon: 1
  space-before-colon: 1
  hex-length: 1
  empty-line-between-blocks: 1
  url-quotes: 1
  zero-unit: 1
  hex-notation: 1
  indentation: 0
  final-newline: 1
options:
  optOut: false

Disabling Rules

resolvers:
  property-sort-order: 1
  attribute-quotes: 0

By default, all rule "resolvers" are enabled. If you wish to change that, specify a config file when running. Configuration of resolvers only allows you to enable or disable rules.

  sass-lint-auto-fix -c path/to/config.file

Configuring which rules to run against

By default, sass-lint will look for a .sass-lint.yml or .sasslintrc, or an entry in your package.json. When applying the resolver to a given rule, configuration is parsed from one of the above files..

More information is specified here.

In this snippet example, the only rule enabled is property-sort-order. If you wish to manually enable certain resolvers, you would do so for each one you wish to include.

For more information about the rules themselves, you can read the documentation from sass-lint

Opt out of error reporting

By default, all errors captured while attempting to resolve issues are reported by sentry.

You can opt out by adding a optOut flag in your sass-lint-auto-fix config file (yml, json, js, ts)

E.g

files:
  include: "**/*.s+(a|c)ss"
  ignore:
    - node_modules/**
syntax:
    include:
      - scss
resolvers:
  property-sort-order: 1
  attribute-quotes: 1
  ...
options:
  optOut: true

Developing

Setup

git clone https://github.com/srowhani/sass-lint-auto-fix.git;
yarn install;
yarn build;

Contributing

This project uses semantic-release. Scope of the commit's included in a pull request will decide whether a new release is warranted.

More information can be found here.

Testing

yarn test

sass-lint-auto-fix's People

Contributors

a2nt avatar alubchuk avatar dependabot-preview[bot] avatar jgillman avatar mmorearty avatar pajamaw avatar sascha-egerer avatar semantic-release-bot avatar srowhani avatar tofandel avatar webbertakken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sass-lint-auto-fix's Issues

RangeError: Invalid count value

Problem Description

When running npm run sass-lint-auto-fix I get the following error. My guess is that a check to avoid errors like this is missing.

RangeError: Invalid count value
    at String.repeat (native)
    at Logger.pad (/project/node_modules/sass-lint-auto-fix/dist/helpers/logger.js:17:26)
    at Logger.warn (/project/node_modules/sass-lint-auto-fix/dist/helpers/logger.js:43:62)
    at /project/node_modules/sass-lint-auto-fix/dist/sass-lint-auto-fix.js:82:38
    at Array.map (<anonymous>)
    at SlAutoFix.processFile (/project/node_modules/sass-lint-auto-fix/dist/sass-lint-auto-fix.js:59:22)
    at /project/node_modules/sass-lint-auto-fix/dist/sass-lint-auto-fix.js:33:19
    at Array.forEach (<anonymous>)
    at SlAutoFix.run (/project/node_modules/sass-lint-auto-fix/dist/sass-lint-auto-fix.js:31:15)
    at /project/node_modules/sass-lint-auto-fix/dist/index.js:57:21

`--config .sass-lint.yml` gives `undefined:1 files:`

Problem Description

--config .sass-lint.yml gives undefined:1 files:

Steps to recreate

  • put .sass-lint.yml at the root of the project with following content:
files:
  include: '**/*.s+(a|c)ss'
syntax:
    include:
      - scss
      - sass
resolvers:
  property-sort-order: 1
  attribute-quotes: 1
  border-zero: 1
  no-color-keywords: 1
  no-css-comments: 0
  no-important: 0
  no-trailing-zero: 1
  space-after-bang: 1
  space-before-bang: 1
  space-after-colon: 1
  space-before-colon: 1
  hex-length: 1
  • run sass-lint -c .sass-lint.yml and see that it works
  • run sass-lint-auto-fix -c .sass-lint.yml and get an error:
undefined:1
syntax:
^

SyntaxError: Unexpected token s in JSON at position 0
    at JSON.parse (<anonymous>)
    at /usr/local/lib/node_modules/sass-lint-auto-fix/dist/index.js:162:44
    at /usr/local/lib/node_modules/sass-lint-auto-fix/dist/index.js:173:7
    at /usr/local/lib/node_modules/sass-lint-auto-fix/dist/index.js:3:68
    at Object.<anonymous> (/usr/local/lib/node_modules/sass-lint-auto-fix/dist/index.js:6:2)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)

Hope you can help, and thank you so much for your work on this repo!

Cannot read property 'is' of undefined, no other info

Problem Description

I get loads of the error message Cannot read property 'is' of undefined, without an further logging. So I have no clue what is going on here.

Screenshot

screen shot 2018-08-29 at 18 44 14

Steps to recreate

  • .sass-lint.yml without rules
  • run sass-lint-auto-fix

Color functions being replaced by actual colors

Hi! I'm testing your package as a replacement to CSSComb and found a serious issue.

Problem Description

Color functions being replaced by actual colors

Sample code

/// Calculate the luminance for a color.
/// @access private
/// @param {color} $color
/// @link https://medium.com/dev-channel/using-sass-to-automatically-pick-text-colors-4ba7645d2796
/// @link https://www.w3.org/TR/WCAG20/#relativeluminancedef
@function _luminance($color) {
  $red: red($color) + 1;
  $green: green($color) + 1;
  $blue: blue($color) + 1;

  $red: nth($_mdc-linear-channel-values, $red);
  $green: nth($_mdc-linear-channel-values, $green);
  $blue: nth($_mdc-linear-channel-values, $blue);

  @return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
}

Steps to recreate

  • Just
  • run
  • "sass-lint-auto-fix"

Maintaining Official Sass-Lint

Hey!

On behalf of the Sass Lint team, I'm sorry it's taken so long to sync up with you. We've all been too busy to dedicate time to this and we're sorry about that. I'm looking to onboard a couple new maintainers tomorrow and would love to include you in that. The plan is to have the meeting at 11am Central Thursday morning. If you're available and interested, please DM me your email address on Twitter so I can add you to that call. If not, and you're interested, we can find another time to get you onboarded.

Thanks for the work you've done with Sass Lint so far! Hopefully you're interested in working on the official project!

Getting unknown error when run sass-lint-auto-fix -c filesToLint

Problem Description

Getting below error:
/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:106
return this.content.some(function (node) {
^

TypeError: this.content.some is not a function
at Node.contains (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:106:26)
at Node. (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/sass-lint/lib/rules/space-before-bang.js:15:38)
at /Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:314:54
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:288:6)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
at Node.traverse (/Users/sg0220984/.nvm/versions/node/v8.9.0/lib/node_modules/sass-lint-auto-fix/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)

Screenshot

screen shot 2018-05-09 at 1 11 31 pm

Steps to Recreate
run sass-lint-auto-fix -c .sass-lint.yml 'app/**/*.scss' -v -q

Allow multiple include paths

Problem Description

Perhaps this is already possible, but it doesn't seem to be. I would like to be able to include multiple paths in my config file, exactly the same way that sass-lint allows. For example, inside my config yml file:

files:
  include:
    - sass/**/*.s+(a|c)ss
    - ../anotherdirectory/sass/**/*.s+(a|c)ss

Running npm run lint:fix with the above config gives me the error TypeError: glob pattern string required.

Is this possible? Is there a work around that doesn't involve maintaining another config file inside of the other directory and running npm run lint:fix twice (once from each directory)?

more property-sort-order rules?

I need some more property-sort-order rules

sass-lint-auto-fix fixes property-sort-order by alphabetical sequence by default.
could you arrange the option to be able to choose "concentric", "smacss" and "recess" like following.

resolvers:
  property-sort-order: "smacss"

or

  property-sort-order: 
    enabled: true
    order:
        - content
        - position
        - top
        - right
        ...

Thank you for your development Anyway!

Remove package dependency on git.

Remove package dependency on git. It creates problem where buildsystem does not support git and supports only npm packages.

Currently package depends on gonzales-pe-sl through a git url. Can we change that and mention package version ^4.2.3 as done in sass-lint package.

screen shot 2018-10-17 at 2 56 06 pm

Let me know if this exists for some reason.
I can raise a PR if this makes sense.

Thanks for the wonderful tool.

Cannot read property 'is' of undefined - final-newline.js:40:15

Problem Description

I ran this command when I installed your package globally.

sass-lint-auto-fix -c .sass-lint.yml

_documents_nrl_working_source_nrl_web_client nrldigital_nrls-macbook-pro-2 -zsh _139x43

My .sass-lint.yml file

files:
    include: 'src/styles/**/*.scss'
    ignore:
        - 'src/styles/ui-framework/mixins/_generate-utils.scss'
        - 'src/styles/ui-framework/utils/_u-spacing.scss'

rules:
    border-zero:
        - 1
        - convention: none

    brace-style:
        - 1
        - style: 'stroustrup'

    class-name-format:
        - 1
        - convention: hyphenatedbem

    empty-line-between-blocks: 1

    extends-before-mixins: 1

    extends-before-declarations: 1

    force-element-nesting: 0

    force-pseudo-nesting: 0

    indentation:
        - 1
        - size: 2

    leading-zero:
        - 0
        - include: false

    mixins-before-declarations:
        - 1
        - exclude: ['media-query', 'mq']

    nesting-depth:
        - 0
        - max-depth: 3

    no-color-keywords: 0

    no-color-literals: 0

    no-important: 0

    no-mergeable-selectors: 0

    no-trailing-zero: 0

    no-transition-all: 0

    no-vendor-prefixes: 0

    no-warn: 0

    pseudo-element: 0

    placeholder-in-extend: 0

    placeholder-name-format:
        - 1
        - allow-leading-underscore: true
          convention: '[a-z]+([-_].+)?'

    property-sort-order:
        - 1
        - ignore-custom-properties: true

    space-around-operator: 0

    space-before-colon: 0

    quotes:
        - 1
        - style: double

    variable-name-format:
        - 1
        - allow-leading-underscore: true
          convention: '[a-z]+([-_].+)?'

Resolver final-newline not working

Problem Description

After trying to update the resolvers with a property from the list, the property final-newline: 1 is not working.

Screenshot

screen shot 2018-05-08 at 3 15 47 pm

Steps to recreate

  • Add final-newline: 1 under resolvers in .sass-lint.yml
  • Run sass-lint-auto-fix -c .sass-lint.yml -v

this.content.some is not a function

Problem Description

I run sass-lint-auto-fix (worked about a month ago) on my repository.
Version before and still: "sass-lint-auto-fix": "0.4.0",

Screenshot

@fix       Running resolver property-sort-order on src/app/quill/quill-box/quill-box.overrides.scss
@write     Writing resolved tree to src/app/quill/quill-box/quill-box.overrides.scss
/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:106
            return this.content.some(function (node) {
                                ^

TypeError: this.content.some is not a function
    at Node.contains (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:106:26)
    at Node.<anonymous> (/Users/byakubchik/Desktop/bertie/node_modules/sass-lint/lib/rules/space-before-bang.js:15:38)
    at /Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:314:54
    at Node.traverse (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:288:6)
    at Node.traverse (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
    at Node.traverse (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
    at Node.traverse (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
    at Node.traverse (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:293:36)
    at Node.traverseByTypes (/Users/byakubchik/Desktop/bertie/node_modules/gonzales-pe-sl/lib/gonzales.js:313:11)
    at Object.detect (/Users/byakubchik/Desktop/bertie/node_modules/sass-lint/lib/rules/space-before-bang.js:13:9)

Steps to recreate

Looks like you'll want some rule that triggers space-before-bang

Command files in Docker container

Problem Description

I get a generic error Command failed with exit code 1. error when running sass-lint-auto-fix inside a Docker container. Immediately proceeding the error is this (content redacted for readability):

@fix      Running resolver "property-sort-order" on "path/to/file.scss"
@write    Writing resolved tree to path/to/file.scss
{ details: 
   { file: 
      { filename: 'path/to/file.scss',
        content: 'SCSS CONTENT',
        options: [Object] } } }

If I re-run the command, it writes the file in question just fine but proceeds to error-out on another file. After re-running a total of 5 times, I get a Done in 13.65s. message and all files are fixed. The files in question appear to be valid save for a few sass-lint complaints. That said, I'm wondering if this is a memory issue i.e. there isn't enough memory to process larger files?

Trailing-zero broken

Screenshot

image

Steps to recreate

  • Running slaf on file with no-trailing-zero lint errors

Property sort order recess / smacss/ concentric doesn't work

Problem Description

Property resolves alphabetically, but not in other orders like recess, smacss or concentric.

They're hints in the code, but it seems that the yaml files are missing.

Steps to recreate

  • Put sass-lint.yml at the root of the project with following content:
resolvers:
  property-sort-order:
    - 1
    - order: concentric
  • Run sass-lint-auto-fix -c sass-lint.yml
  • Property sort is alphabetically

Important being stripped by default, can break code.

Problem Description

The default configuration is too aggressive. It can break things.

Specifically the resolver no-important is set to 1 by default. Which makes it little desirable to have it under a pre-commit hook.

Steps to reproduce

  • Run sass-lint-auto-fix without a configuration, having a file that uses important.
  • Notice the important simply being stripped, which in most cases would break code.

Desired behaviour

Trust on default rules to not break your code.

I can make a PR if you please.

HTTP error 429

Problem Description

After running npm run sass-lint-auto-fix, I get a load of http errors.

{ SentryError: HTTP Error (429)
    at new SentryError (/project/node_modules/@sentry/core/dist/error.js:18:28)
    at ClientRequest.<anonymous> (/project/node_modules/@sentry/node/dist/transports/base.js:100:44)
    at Object.onceWrapper (events.js:272:13)
    at ClientRequest.emit (events.js:180:13)
    at ClientRequest.emit (domain.js:421:20)
    at HTTPParser.parserOnIncomingClient (_http_client.js:539:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
    at TLSSocket.socketOnData (_http_client.js:444:20)
    at TLSSocket.emit (events.js:180:13)
    at TLSSocket.emit (domain.js:421:20) name: 'SentryError' }

space-after-colon broken

Problem Description

  transition: background-color .5s,color .5s;

resolver
space-after-colon: 1
should fix it. bot does nothing

EDIT: my fault, somehow thought of comma instead.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Preserve sass-lint directive comment positions

Problem Description

When a comment is used to disable linting for a particular rule (e.g. // sass-lint:disable-line rule-name) and the fixer rearranges the rule to obey the property-sort-order lint config, the comment stays where it was. This can cause lint errors because the ignore directive is no longer being applied to the correct line.

`files.ignore` does not work

Problem Description

Giving the following config

files:
  include: 'src/**/*.s+(a|c)ss'
  ignore:
    - 'src/sass/**/*.s+(a|c)ss'

It still check the sass folder.
I then tried with the following.

files:
  include: 'src/**/*.s+(a|c)ss'
  ignore: random

No error is thrown. Seems like this setting does not work at all

Screenshot

Part of the output showing that it is still include the excluded files
image

Steps to recreate

  • Use ignore to ignore some files
  • run fix

Does not fix `empty-line-between-blocks`

Problem Description

sass-lint-auto-fix does not resolve empty-line-between-blocks

Steps to recreate

make your sass-lint configuration file have:

rules:
  empty-line-between-blocks: 1

Have your scss file include blocks of css without a space, e.g.

.some-class {
  border: 0
}
.other-class {
  border: 1
}

Note that after running sass-lint-auto-fix --verbose no empty line is added between the two blocks.

I see that the feature is not currently present: https://github.com/srowhani/sass-lint-auto-fix/tree/master/src/resolvers

I appreciate the work you do πŸ™‡

indentation is not auto fixed

Problem Description

I am searching a solution to fix bad indentation in my scss files and i thought that sass-lint-auto-fix was made for that. But it does not work and i dont understand. Could you confim me that your lib can do indentation fix auto ?

Thanks

Put into words briefly what you have encountered

Screenshot

Helps to recreate the issue

Steps to recreate

  • List
  • of
  • steps
  • to
  • recreate

No dist/ folder in npm packages for v0.3.1+

Problem Description

The npm package for sass-lint-auto-fix appears to be missing a dist directory in all versions since v0.3.1. Since that directory contains all of the code, this renders the package unusable.

Screenshot

Not a screenshot, but here's a terminal transcript:

HOME derpbox:/tmp/foo$ npm install [email protected]
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! path /tmp/foo/node_modules/sass-lint-auto-fix/dist/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/foo/node_modules/sass-lint-auto-fix/dist/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/adrake/.npm/_logs/2018-04-17T06_08_04_862Z-debug.log
HOME derpbox:/tmp/foo$ npm install sass-lint-auto-fix@latest
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! path /tmp/foo/node_modules/sass-lint-auto-fix/dist/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/foo/node_modules/sass-lint-auto-fix/dist/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/adrake/.npm/_logs/2018-04-17T06_08_08_662Z-debug.log

Steps to recreate

  • Create an empty directory
  • Run npm init -y
  • Run npm install sass-lint-auto-fix or npm install [email protected]

Does not fix "empty-line-between-blocks"

Problem Description

I saw some issues about the rule "empty-line-between-blocks" not being fixed that were resolved, but the problem still exists for me.

  • sass-lint-auto-fix v0.16.1
  • sass-lint v1.12.1

Some code

.sass-lint-auto-fix.yml

...
  empty-line-between-blocks: 1
...

.sass-lint

...
  empty-line-between-blocks:
    - 1
    - include: true
      allow-single-line-rulesets: false
...

The following codes will remain the same:

.question-and-answers {
    margin-bottom: 20px;
    &__question {
        margin-bottom: 15px;
    }
}
.settings-page {
    h2 {
        margin: 20px 0;
    }
    
    .form-horizontal {
        .label {
            display: inline-block;
        }
        .title {
            display: block;
        }
    }
}

The output of sass-lint-auto-fix will still give me:

@fix       Running resolver "empty-line-between-blocks" on "resources/assets/sass/studocu/pages/_settings.scss"
@write     Writing resolved tree to resources/assets/sass/studocu/pages/_settings.scss

So to sum up, everything seems working fine, except the files are not written (?) or the rule is not working (?).

-webkit-image-set

Problem Description

I get an error when trying to fix a file that is using -webkit-image-set function.

Screenshot

error

Cannot checkout repository on windows

Problem Description

I cannot checkout this repository as windows does not allow an * in file names.

Screenshot

Cloning into 'C:\Projects\sass-lint-auto-fix'... error: unable to create file test/sample-config/config.*: Invalid argument fatal: unable to checkout working tree warning: Clone succeeded, but checkout failed.

Steps to recreate

Clone repository on windows.

Parse issue with @import

Problem Description

Can not parse @import in scss file

Put into words briefly what you have encountered
I've executed such command
sass-lint-auto-fix -c sass-lint-auto-fix.yml

The following file contains:
files:
include: "/*.s+(a|c)ss"
ignore:
- node_modules/

syntax:
include:
- scss
- sass
resolvers:
property-sort-order: 1

It processed a couple of scss files without @import well but was stopped when tried to parse file with @import '../../base-vars.scss'

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Border-zero resolver is buggy

Problem Description

Wen enabled, border-zero resolver does not account for integer value in sass-lint.yml
The resolver will only work if we provide a string instead of integer here (i. e. '0').

If, on the other hand, integer value is provided, the program will write border: ; to the file (just an empty space instead of border: 0;.

# sass-lint.yml
rules:
  border-zero:
    - 2
    -
      convention: 0 # <-- notice integer value instead of string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.