npm

Need private packages and team management tools?Check out npm Orgs. »

@10up/stylelint-config

1.0.5 • Public • Published

10up Stylelint Config

At 10up, we strive to provide digital products that yield a top-notch user experience. In order to improve both our efficiency and consistency, we need to standardize what we use and how we use it. This theme scaffold allows us to share initial set up procedures to make sure all projects can get up and running as quickly as possible while closely adhering to 10up's high quality standards.

Support Level

Dependencies

  1. Node & NPM - 3rd party dependencies are managed through NPM, so you will need that installed globally
  2. Stylelint - as this is a config extention for Stylelint, you will need Stylelint installed in your main project in order for it to work.

Installation

First, install Stylelint:

// NPM
npm install stylelint --save-dev

// Yarn
yarn add stylelint

Then install the 10up Stylelint config:

// NPM
npm install @10up/stylelint-config --save-dev

Usage

Add the following to your .stylelintrc file:

{
  "extends": [
    "@10up/stylelint-config"
  ]
}
 

Webpack Setup

Run npm install stylelint-webpack-plugin --save-dev. You should already have the proper loader in postcss-loader, but if you don't install that as well. After installing stylelint and the configuration above add the following to your Webpack config:

import StyleLintPlugin from 'stylelint-webpack-plugin';
 
plugins: [
  new StyleLintPlugin( {
    configFile: ".stylelintrc", // if your config is in a non-standard place
    files: "src/**/*.css", // location of your CSS files
    fix: true, // if you want to auto-fix some of the basic rules
  } ),
]
 

Read more about these options at stylelint-webpack-plugin, the main stylelint documentation and postcss-loader. That should be all you need, but if there are any errors in this documentation, please file an issue and let us know!

Usage with the 10up Theme Scaffold

As of version [x] - this stylelint config as well as stylelint itself, will be included in the theme and plugin scaffolds.

Autofixing

Certain rules / violations can be fixed automatically using the --fix flag via the command line. To ensure that Stylelint fixes what it can, you can run:

stylelint path/to/css/file.css --fix`

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Contributing

We don't know everything! We welcome pull requests and spirited, but respectful, debates. Please contribute via pull requests on GitHub.

  1. Fork it!
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Added some great feature!'
  4. Push to the branch: git push origin feature/my-new-feature
  5. Submit a pull request

Like what you see?

Work with 10up, we create amazing websites and tools that make content management simple and fun using open source tools and platforms

install

npm i @10up/stylelint-config

Downloadsweekly downloads

744

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability