Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stylelint-order; remove stylefmt in favor of stylelint --fix #1310

Merged
merged 6 commits into from
Jun 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,56 @@
// ESLint configuration
// http://eslint.org/docs/user-guide/configuring
module.exports = {
parser: 'babel-eslint',
parser: 'babel-eslint',

extends: [
'airbnb',
'plugin:css-modules/recommended',
],
extends: [
'airbnb',
'plugin:css-modules/recommended',
],

plugins: [
'css-modules',
],
plugins: [
'css-modules',
],

globals: {
__DEV__: true,
},
globals: {
__DEV__: true,
},

env: {
browser: true,
},
env: {
browser: true,
},

rules: {
// `js` and `jsx` are common extensions
// `mjs` is for `universal-router` only, for now
'import/extensions': [
'error',
'always',
{
js: 'never',
jsx: 'never',
mjs: 'never',
},
],
rules: {
// `js` and `jsx` are common extensions
// `mjs` is for `universal-router` only, for now
'import/extensions': [
'error',
'always',
{
js: 'never',
jsx: 'never',
mjs: 'never',
},
],

// Not supporting nested package.json yet
// https://github.com/benmosher/eslint-plugin-import/issues/458
'import/no-extraneous-dependencies': 'off',
// Not supporting nested package.json yet
// https://github.com/benmosher/eslint-plugin-import/issues/458
'import/no-extraneous-dependencies': 'off',

// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
},
],
// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
},
],

// Allow js files to use jsx syntax, too
'react/jsx-filename-extension': 'off',
// Allow js files to use jsx syntax, too
'react/jsx-filename-extension': 'off',

// https://github.com/kriasoft/react-starter-kit/pull/961
// You can reopen this if you still want this rule
'react/prefer-stateless-function': 'off',
},
};
// https://github.com/kriasoft/react-starter-kit/pull/961
// You can reopen this if you still want this rule
'react/prefer-stateless-function': 'off',
},
};
31 changes: 25 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# See https://help.github.com/ignore-files/ for more about ignoring files.

.idea
# Dependencies
node_modules/

# Compiled output
build

# Runtime data
database.sqlite
node_modules
npm-debug.log
yarn-error.log

# Test coverage
coverage
.nyc_output

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editors and IDEs
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Misc
.DS_Store
26 changes: 22 additions & 4 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,42 @@ module.exports = {
// https://github.com/stylelint/stylelint-config-standard
extends: 'stylelint-config-standard',

plugins: [
// stylelint plugin to sort CSS rules content with specified order
// https://github.com/hudochenkov/stylelint-order
'stylelint-order',
],

rules: {
'property-no-unknown': [true, {
ignoreProperties: [
// CSS Modules composition
// https://github.com/css-modules/css-modules#composition
'composes'
]
'composes',
],
}],

'selector-pseudo-class-no-unknown': [true, {
ignorePseudoClasses: [
// CSS Modules :global scope
// https://github.com/css-modules/css-modules#exceptions
'global'
]
'global',
],
}],

// Opinionated rule, you can disable it if you want
'string-quotes': 'single',

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md
'order/order': [
'custom-properties',
'dollar-variables',
'declarations',
'at-rules',
'rules',
],

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
'order/properties-order': [],
},
};
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- '8'
- '7'
- '6'
env:
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
"react-test-renderer": "^15.5.4",
"rimraf": "^2.6.1",
"sinon": "^2.3.4",
"stylefmt": "^6.0.0",
"stylelint": "^7.11.0",
"stylelint-config-standard": "^16.0.0",
"stylelint-order": "^0.5.0",
"url-loader": "^0.5.8",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.8.2",
Expand Down Expand Up @@ -150,13 +150,12 @@
"git add"
],
"*.{css,less,scss,sss}": [
"stylefmt",
"stylelint",
"stylelint --fix",
"git add"
]
},
"scripts": {
"lint:js": "eslint src tools",
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
"lint:css": "stylelint \"src/**/*.{css,less,scss,sss}\"",
"lint:staged": "lint-staged",
"lint": "yarn run lint:js && yarn run lint:css",
Expand Down
Loading