sir-dunxalot / ember-cli-sass-lint Goto Github PK
View Code? Open in Web Editor NEWPure Node.js sass/scss linting for Ember CLI projects
License: MIT License
Pure Node.js sass/scss linting for Ember CLI projects
License: MIT License
The problem depends on broccoli-sass-lint
issue: sir-dunxalot/broccoli-sass-lint#9. Waiting for a patch release ๐
I am trying to install ember-cli-sass-lint in an addon with the following simplified folder structure:
addon
app
-- styles
-- my-addon-name
addon.scss
_partial1.scss
_partial2.scss
In my (dummy) app's app.scss I then use
import 'my-addon-name/addon';
Which works well so far. However, I cannot get the files in app/styles to lint. I tried to include the example config file, slightly adapted:
#########################
## Sample Sass Lint File
#########################
# Linter Options
# options:
# File Options
files:
include: 'app/styles/**/*.scss'
# Rule Configuration
rules:
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
mixins-before-declarations:
- 2
-
exclude:
- breakpoint
- mq
no-warn: 1
no-debug: 1
no-ids: 2
no-important: 2
hex-notation:
- 2
-
style: uppercase
indentation:
- 2
-
size: 2
property-sort-order:
- 1
-
order:
- display
- margin
ignore-custom-properties: true
variable-for-property:
- 2
-
properties:
- margin
- content
But it is only linting the app.scss file from the dummy app.
From the README:
Linting configuration can be added in a
sass-lint.yml
file as required by Sass Lint.
This is misleading. sass-lint defaults to a dotfile called .sass-lint.yml. So to be consistent with the upstream project, you have to specify configuration for this addon in ember-cli-build.js. Can it use the same default as sass-lint?
All file options seem to be ignored. Even when setting it to include nonsense files, it still uses the sass-lint default glob pattern of **/*.s+(c|a)ss
. I've tried using the following, but it still tries to lint every scss
file in the project.
files:
include: '*.asdasdasd'
ignore:
- '**/semantic-ui/**/*.scss'
- '**/auth0-override.scss'
- '**/login.scss'
- '**/header.scss'
- '**/banners.scss'
rules:
property-sort-order: 0
....
In 1.0.4, all the *.js
files in app/
appear in assets/tests.js
without transpilation. Reverting back to 1.0.3 fixes the issue, so maybe it's due to the changes in a433f93.
I think it's the same issue as ember-cli/ember-cli#7063 (and fixed by https://github.com/billybonks/ember-cli-stylelint/pull/71/files for ember-cli-stylelint
).
Linting seems to work properly and report errors and warnings at the start of testing, but then I get these two failures which ultimately fail the build:
not ok 10 PhantomJS 1.9 - TestLoader Failures ecommerce/tests/app.sass-lint-test: could not be loaded
---
message: >
Can't find variable: module
stack: >
ReferenceError: Can't find variable: module
at http://localhost:7357/assets/tests.js:67
at http://localhost:7357/assets/vendor.js:92
at http://localhost:7357/assets/vendor.js:142
at findModule (http://localhost:7357/assets/vendor.js:190)
at http://localhost:7357/assets/vendor.js:177
at http://localhost:7357/assets/test-loader.js:67
at http://localhost:7357/assets/test-loader.js:58
at http://localhost:7357/assets/test-loader.js:89
at http://localhost:7357/assets/test-support.js:25971
Log: |
...
not ok 11 PhantomJS 1.9 - TestLoader Failures ecommerce/tests/app.sass-lint-test: could not be loaded
---
message: >
Can't find variable: module
stack: >
ReferenceError: Can't find variable: module
at http://localhost:7357/assets/tests.js:67
at http://localhost:7357/assets/vendor.js:92
at http://localhost:7357/assets/vendor.js:142
at findModule (http://localhost:7357/assets/vendor.js:190)
at http://localhost:7357/assets/vendor.js:177
at http://localhost:7357/assets/test-loader.js:67
at http://localhost:7357/assets/test-loader.js:58
at http://localhost:7357/assets/test-loader.js:89
at http://localhost:7357/assets/test-support.js:25971
Log: |
...
What do I need to do to fix this? I'm using Mocha/Chai instead of Qunit. Thanks!
I'd like to propose changing the tree passed to broccoli-sass-lint from this.app.trees.styles
as currently implemented to this.app.trees.app
. The latter is a superset of the former, and it results in including .scss/.sass files that are colocated with their components in app/components subdirectories. I don't think there would be an appreciable performance hit or other problems.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.