Skip to content

Commit 67dbc8c

Browse files
committed
Initial commit
0 parents  commit 67dbc8c

File tree

12 files changed

+8405
-0
lines changed

12 files changed

+8405
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.github/workflows/nodejs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'dependabot/**'
8+
pull_request:
9+
branches:
10+
- '**'
11+
12+
env:
13+
CI: true
14+
15+
jobs:
16+
lint:
17+
name: Lint on Node.js ${{ matrix.node }} and ${{ matrix.os }}
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
strategy:
22+
matrix:
23+
node: [12]
24+
os: [ubuntu-latest]
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: Use Node.js ${{ matrix.node }}
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: ${{ matrix.node }}
33+
34+
- name: Install latest npm
35+
run: npm install --global npm@latest
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Lint
41+
run: npm run lint
42+
43+
- name: Test
44+
run: npm run test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.eslintcache

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tag-version-prefix = ""

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0
2+
3+
- Initial release.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 - present stylelint
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# @stylelint/npm-package-json-lint-config
2+
3+
[![NPM version](https://img.shields.io/npm/v/@stylelint/npm-package-json-lint-config.svg)](https://www.npmjs.org/package/@stylelint/npm-package-json-lint-config) [![Build Status](https://github.com/stylelint/npm-package-json-lint-config/workflows/CI/badge.svg)](https://github.com/stylelint/npm-package-json-lint-config/actions)
4+
5+
> stylelint org's shareable config for npm-package-json-lint-config.
6+
7+
For consistent `package.json` files across stylelint org repos.
8+
9+
## Installation
10+
11+
```console
12+
$ npm install @stylelint/npm-package-json-lint-config --save-dev
13+
```
14+
15+
## Usage
16+
17+
Add this to your `package.json`:
18+
19+
```json
20+
{
21+
"npmpackagejsonlint": "@stylelint/npm-package-json-lint-config"
22+
}
23+
```
24+
25+
## [Changelog](CHANGELOG.md)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
'use strict';
2+
3+
module.exports = {
4+
// See https://www.npmjs.com/package/npm-package-json-lint-config-default
5+
extends: 'npm-package-json-lint-config-default',
6+
rules: {
7+
'description-format': ['error', { requireCapitalFirstLetter: true, requireEndingPeriod: true }],
8+
'no-duplicate-properties': 'error',
9+
'no-file-dependencies': 'error',
10+
'no-file-devDependencies': 'error',
11+
'no-git-dependencies': 'error',
12+
'no-git-devDependencies': 'error',
13+
'prefer-alphabetical-dependencies': 'error',
14+
'prefer-alphabetical-devDependencies': 'error',
15+
'prefer-alphabetical-peerDependencies': 'error',
16+
'prefer-alphabetical-scripts': 'error',
17+
'prefer-no-engineStrict': 'error',
18+
'prefer-property-order': [
19+
'error',
20+
[
21+
'name',
22+
'private',
23+
'version',
24+
'description',
25+
'keywords',
26+
'homepage',
27+
'repository',
28+
'funding',
29+
'bugs',
30+
'license',
31+
'author',
32+
'main',
33+
'bin',
34+
'files',
35+
'directories',
36+
'type',
37+
'module',
38+
'publishConfig',
39+
'engines',
40+
// VS Code
41+
'publisher',
42+
'displayName',
43+
'qna',
44+
'galleryBanner',
45+
'icon',
46+
'categories',
47+
'activationEvents',
48+
'contributes',
49+
'commands',
50+
'jsonValidation',
51+
'languages',
52+
'snippets',
53+
// Repo
54+
'eslintConfig',
55+
'jest',
56+
'husky',
57+
'lint-staged',
58+
'npmpackagejsonlint',
59+
'prettier',
60+
'remarkConfig',
61+
'dependencies',
62+
'devDependencies',
63+
'peerDependencies',
64+
'scripts',
65+
],
66+
],
67+
'require-author': 'error',
68+
'require-bugs': 'error',
69+
'require-description': 'error',
70+
'require-engines': 'error',
71+
'require-homepage': 'error',
72+
'require-keywords': 'error',
73+
'require-license': 'error',
74+
'require-main': 'error',
75+
'require-name': 'error',
76+
'require-repository': 'error',
77+
'require-scripts': 'error',
78+
'require-version': 'error',
79+
'valid-values-author': ['error', ['stylelint']],
80+
'valid-values-license': ['error', ['MIT']],
81+
'valid-values-publishConfig': ['error', [{ access: 'public' }]],
82+
},
83+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
const isPlainObj = require('is-plain-obj');
4+
const npmpackagejsonlintConfig = require('./npm-package-json-lint-config');
5+
6+
describe('npm-package-json-lint config tests', () => {
7+
describe('npm-package-json-lint config object', () => {
8+
test('should be an object', () => {
9+
expect(isPlainObj(npmpackagejsonlintConfig)).toBe(true);
10+
});
11+
});
12+
13+
describe('extends', () => {
14+
test('should not be an object', () => {
15+
expect(isPlainObj(npmpackagejsonlintConfig.extends)).toBe(false);
16+
});
17+
});
18+
19+
describe('rules', () => {
20+
test('should be an object', () => {
21+
expect(isPlainObj(npmpackagejsonlintConfig.rules)).toBe(true);
22+
});
23+
});
24+
});

0 commit comments

Comments
 (0)