Roots Discourse

Yarn start > Unexpected missing end-of-source newline no-missing-end-of-source-newline

sage9

#1

i am a newly of sage9, I finally finished the installation of the theme and all the stuff that I need for this.
I started to write some basic css just to test if everything works well.

I run yarn start and I wrote this css in the _pages.scss (a quick and stupid test)

body {
  background-color: green;
}

but this given to me this error:

resources/assets/styles/layouts/_pages.scss
 3:1  ✖  Unexpected missing end-of-source newline   no-missing-end-of-source-newline

i know that I can disable StyleLint plugin in the webpack.config.js, but I would like to keep this so I can learn how I can write a more clean code.

but I don’t understand what I am doing wrong.
any suggestion?

thanks


#2

Add a return at the bottom of your _pages.scss file.

body {
  background-color: green;
}


#3

thanks @MWDelaney, it works like a charm


#4

I got same error. And put this code al .scss files (footer, header, pages, posts, sidebar…) but stil showing this error.

Trying this code:

body {
    background-color: yellowgreen;
}

2:5  ×  Expected indentation of 2 spaces           indentation
3:1  ×  Unexpected missing end-of-source newline   no-missing-end-of-source-newline

#5

you have to indent background-color with 2 spaces and you should add a new line at the end

like this
30


#6

Thank you it works. Is any options change it to 4 spaces?


#7

#8

@mattia that’s for PHP and not CSS, and no longer relevant

@bilalmalkoc read up on stylelint documentation