Skip to content

Commit

Permalink
Add particular case for ordering package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Oct 1, 2024
1 parent 4529bd6 commit d2761bb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 21 deletions.
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "@carrismetropolitana/eslint",
"version": "1.0.0",
"main": "./dist/index.js",
"type": "module",
"types": "./dist/index.d.ts",
"files": [
"dist/"
],
"scripts": {
"start": "tsc && node dist/index.js",
"lint": "eslint .",
"build": "tsc",
"watch": "tsc -w",
"lint:fix": "eslint . --fix"
},
"publishConfig": {
"access": "public"
},
"author": "João de Vasconcelos",
"license": "AGPL-3.0-or-later",
"homepage": "https://github.com/carrismetropolitana/eslint#readme",
"bugs": {
"url": "https://github.com/carrismetropolitana/eslint/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/carrismetropolitana/eslint.git"
},
"bugs": {
"url": "https://github.com/carrismetropolitana/eslint/issues"
},
"keywords": [
"public transit",
"eslint",
"lint"
],
"author": "João de Vasconcelos",
"license": "AGPL-3.0-or-later",
"publishConfig": {
"access": "public"
},
"type": "module",
"files": [
"dist/"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"start": "tsc && node dist/index.js",
"watch": "tsc -w"
},
"dependencies": {
"@eslint/compat": "1.1.1",
"@eslint/js": "9.11.1",
Expand Down
33 changes: 33 additions & 0 deletions rules/common.rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,37 @@ export default tseslint.config(
},
},

{
files: ['package.json'],
rules: {
'@stylistic/comma-dangle': ['error', 'never'],
'jsonc/auto': 'error',
'jsonc/sort-keys': [
'error',
{
order: [
'name',
'version',
'author',
'license',
'homepage',
'bugs',
'repository',
'keywords',
'private',
'publishConfig',
'type',
'files',
'main',
'types',
'scripts',
'dependencies',
'devDependencies',
],
pathPattern: '.*',
},
],
},
},

);

0 comments on commit d2761bb

Please sign in to comment.