Giter VIP home page Giter VIP logo

npm-package-json-lint-config's Introduction

Stylelint

npm version Build Status npm downloads

A mighty CSS linter that helps you avoid errors and enforce conventions.

Features

It's mighty as it:

  • has over 100 built-in rules for modern CSS syntax and features
  • supports plugins so you can create your own custom rules
  • automatically fixes problems where possible
  • supports shareable configs that you can create or extend
  • can be customized to your exact needs
  • has 15k unit tests making it robust
  • is trusted by companies worldwide like Google and GitHub

And it can be extended to:

  • extract embedded styles from HTML, Markdown and CSS-in-JS template literals
  • parse CSS-like languages like SCSS, Sass, Less and SugarSS

How it'll help you

It'll help you avoid errors, for example:

  • invalid things, e.g. malformed grid areas
  • valid things that are problematic, e.g. duplicate selectors
  • unknown things, e.g. misspelled property names

And enforce conventions, for example:

  • disallow things, e.g. specific units
  • enforce naming patterns, e.g. for custom properties
  • set limits, e.g. the number of ID selectors
  • specify notations, e.g. for modern color functions

We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Example output

Example

Guides

Contributors

Stylelint is maintained by volunteers. Without the code contributions from all these fantastic people, Stylelint would not exist. Become a contributor.

Sponsors

Thank you to all our sponsors! Become a sponsor.

Backers

Thank you to all our backers! Become a backer.

Website hosting

Deploys by Netlify

License

The MIT License.

npm-package-json-lint-config's People

Contributors

dependabot[bot] avatar ntwb avatar ybiquitous avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

npm-package-json-lint-config's Issues

Remove local Prettier config from package.json

We should remove these lines:

	"prettier": {
		"arrowParens": "always",
		"endOfLine": "lf",
		"printWidth": 100,
		"singleQuote": true,
		"trailingComma": "all",
		"useTabs": true
	},

From package.json as this local config is overriding the shared @stylelint/prettier-config one, causing the package.jsonto be indented with tabs.

Remove `require-main` rule

Currently, we require the main field:

However, when writing an ECMAScript module (ESM), main is not always necessary. Instead, the exports field is required. So, should we remove the require-main rule from this config?

See also the Node.js documentation.


Note: Until pure ESM packages spread, we can just ignore the rule like this:

 {
   "extends": "@stylelint/npm-package-json-lint-config",
+  "rules": {
+    "require-main": "off"
+  }
 }

Remove redundant sorting rules

We should remove these rules:

'prefer-alphabetical-dependencies': 'error',
'prefer-alphabetical-devDependencies': 'error',
'prefer-alphabetical-peerDependencies': 'error',

As they are redundant. If the dependencies are incorrectly ordered, both npmPackageJsonLint and Prettier will display violations.

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.