Skip to content

Commit

Permalink
chore: update npm-package-json-lint config
Browse files Browse the repository at this point in the history
- Use new config file name: npmpackagejsonlint.config.cjs
- Only use the rules we explicitly want to enforce
- Use overrides to get rid of config files in folders
- Bring files in line with the configuration
- Remove unused `proprietary/LICENSE.md`
  • Loading branch information
matijs committed Jul 30, 2024
1 parent 807f8af commit f63f45a
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 72 deletions.
42 changes: 0 additions & 42 deletions .npmpackagejsonlintrc.json

This file was deleted.

19 changes: 19 additions & 0 deletions npmpackagejsonlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
rules: {
'no-caret-version-dependencies': 'error',
'no-caret-version-devDependencies': 'error',
'no-tilde-version-dependencies': 'error',
'no-tilde-version-devDependencies': 'error',
'require-repository-directory': 'error',
'valid-values-license': ['error', ['EUPL-1.2']],
'valid-values-name-scope': ['error', ['@example']],
},
overrides: [
{
patterns: ['proprietary/**/package.json'],
rules: {
'valid-values-license': ['error', ['SEE LICENSE IN LICENSE.md']],
},
},
],
};
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "@example/design-system",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Design system based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/design-system",
"keywords": [
"nl-design-system"
],
"private": true,
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git",
"directory": "."
},
"engines": {
"node": "^20",
"pnpm": "^9"
Expand Down Expand Up @@ -50,7 +55,7 @@
"lint:css": "stylelint --allow-empty-input '**/*.{css,scss}'",
"lint:js": "eslint --ext .js,.cjs,.mjs,.json,.jsx,.mdx,.ts,.tsx --report-unused-disable-directives .",
"lint:md": "markdownlint '**/*.md'",
"lint:package-json": "npmPkgJsonLint '**/package.json'",
"lint:package-json": "npmPkgJsonLint .",
"lint:package-lock": "pnpm ls --recursive",
"lint-fix": "npm-run-all --continue-on-error lint-fix:** prettier",
"lint-fix:css": "stylelint --fix '**/*.{css,scss}'",
Expand Down
9 changes: 7 additions & 2 deletions packages/components-css/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"name": "@example/components-css",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "CSS Components for a design system based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/components-css",
"keywords": [
"nl-design-system"
],
"private": true
"private": true,
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git",
"directory": "packages/components-css"
}
}
5 changes: 3 additions & 2 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@example/components-react",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "React component library for the Example repository, based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/components-react",
"keywords": [
"nl-design-system"
],
Expand All @@ -14,7 +14,8 @@
},
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example-community.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "packages/components-react"
},
"scripts": {
"build": "npm-run-all clean build:**",
Expand Down
5 changes: 3 additions & 2 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@example/storybook",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Storybook based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/storybook",
"keywords": [
"nl-design-system"
],
"private": true,
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "packages/storybook"
},
"scripts": {
"build": "storybook build --output-dir dist/ --config-dir config/",
Expand Down
5 changes: 3 additions & 2 deletions packages/web-components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "@example/web-components-react",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "React web components bundle based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/web-components-react",
"keywords": [
"nl-design-system"
],
"private": true,
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "packages/web-components-react"
},
"sideEffects": false,
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions packages/web-components-stencil/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@example/web-components-stencil",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Stencil web components bundle based on the NL Design System architecture",
"license": "EUPL-1.2",
"name": "@example/web-components-stencil",
"keywords": [
"nl-design-system"
],
Expand All @@ -20,7 +20,8 @@
],
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "packages/web-components-stencil"
},
"scripts": {
"build": "npm-run-all clean build:**",
Expand Down
5 changes: 0 additions & 5 deletions proprietary/.npmpackagejsonlintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions proprietary/LICENSE.md

This file was deleted.

5 changes: 3 additions & 2 deletions proprietary/assets/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@example/assets",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Assets",
"license": "SEE LICENSE IN LICENSE.md",
"name": "@example/assets",
"keywords": [
"nl-design-system"
],
Expand All @@ -14,6 +14,7 @@
"files": [],
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "proprietary/assets"
}
}
5 changes: 3 additions & 2 deletions proprietary/design-tokens/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@example/design-tokens",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Example design tokens",
"license": "SEE LICENSE IN LICENSE.md",
"name": "@example/design-tokens",
"keywords": [
"nl-design-system"
],
Expand All @@ -13,7 +13,8 @@
},
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "proprietary/design-tokens"
},
"scripts": {
"clean": "rimraf dist/",
Expand Down
5 changes: 3 additions & 2 deletions proprietary/font/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@example/font",
"version": "1.0.0-alpha.0",
"author": "Community for NL Design System",
"description": "Font assets",
"license": "SEE LICENSE IN LICENSE.md",
"name": "@example/font",
"main": "dist/index.css",
"keywords": [
"nl-design-system"
Expand All @@ -17,6 +17,7 @@
],
"repository": {
"type": "git+ssh",
"url": "git@github.com:nl-design-system/example.git"
"url": "git@github.com:nl-design-system/example.git",
"directory": "proprietary/font"
}
}

0 comments on commit f63f45a

Please sign in to comment.