PageSourceSearch

https://npmpackagejsonlint.org/assets/js/f50499ab.8cd40833.js

js npmpackagejsonlint.org collected 2026-10-08 12:01:45 UTC 3,499 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknpm_package_json_lint_website=self.webpackChunknpm_package_json_lint_website||[]).push([[4855],{7417:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>a,contentTitle:()=>c,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"rules/scripts/prefer-alphabetical-scripts","title":"prefer-alphabetical-scripts","description":"Enabling this rule will result in an error being generated if the scripts in scripts are not in alphabetical order.","source":"@site/docs/rules/scripts/prefer-alphabetical-scripts.md","sourceDirName":"rules/scripts","slug":"/rules/scripts/prefer-alphabetical-scripts","permalink":"/docs/rules/scripts/prefer-alphabetical-scripts","draft":false,"unlisted":false,"editUrl":"https://github.com/tclindner/npm-package-json-lint/edit/master/website/docs/rules/scripts/prefer-alphabetical-scripts.md","tags":[],"version":"current","lastUpdatedBy":"Thomas Lindner","lastUpdatedAt":1646518416000,"frontMatter":{"id":"prefer-alphabetical-scripts","title":"prefer-alphabetical-scripts"}}');var t=n(4848),i=n(8453);const l={id:"prefer-alphabetical-scripts",title:"prefer-alphabetical-scripts"},c=void 0,a={},p=[{value:"Example .npmpackagejsonlintrc configuration",id:"example-npmpackagejsonlintrc-configuration",level:2},{value:"Rule Details",id:"rule-details",level:2},{value:"<em>Incorrect</em> example(s)",id:"incorrect-examples",level:3},{value:"<em>Correct</em> example(s)",id:"correct-examples",level:3},{value:"History",id:"history",level:2}];function o(e){const r={code:"code",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.p,{children:["Enabling this rule will result in an error being generated if the scripts in ",(0,t.jsx)(r.code,{children:"scripts"})," are not in alphabetical order."]}),"\n",(0,t.jsx)(r.h2,{id:"example-npmpackagejsonlintrc-configuration",children:"Example .npmpackagejsonlintrc configuration"}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-json",children:'{\n  "rules": {\n    "prefer-alphabetical-scripts": "error"\n  }\n}\n'})}),"\n",(0,t.jsx)(r.h2,{id:"rule-details",children:"Rule Details"}),"\n",(0,t.jsxs)(r.h3,{id:"incorrect-examples",children:[(0,t.jsx)(r.em,{children:"Incorrect"})," example(s)"]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-json",children:'{\n  "scripts": {\n    "build": "build script",\n    "test": "jest",\n    "start": "node index.js"\n  }\n}\n'})}),"\n",(0,t.jsxs)(r.h3,{id:"correct-examples",children:[(0,t.jsx)(r.em,{children:"Correct"})," example(s)"]}),"\n",(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-json",children:'{\n  "scripts": {\n    "build": "build script",\n    "start": "node index.js",\n    "test": "jest"\n  }\n}\n'})}),"\n",(0,t.jsx)(r.h2,{id:"history",children:"History"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsx)(r.li,{children:"Introduced in version 4.2.0"}),"\n"]})]})}function d(e={}){const{wrapper:r}={...(0,i.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}},8453:(e,r,n)=>{n.d(r,{R:()=>l,x:()=>c});var s=n(6540);const t={},i=s.createContext(t);function l(e){const r=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function c(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),s.createElement(i.Provider,{value:r},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.