Giter Club home page Giter Club logo

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

@stylelint/npm-package-json-lint-config

NPM version CI

Stylelint org's shareable config for npm-package-json-lint.

For consistent package.json files across Stylelint org repos.

Installation

npm install @stylelint/npm-package-json-lint-config --save-dev

Usage

Add this to your package.json:

{
  "npmpackagejsonlint": {
    "extends": "@stylelint/npm-package-json-lint-config"
  }
}

If you prefer, add this too:

{
  "scripts": {
    "lint:packagejson": "npmPkgJsonLint ."
  }
}

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.