PackageJSON Plugin
Rules for linting Node.js package.json manifest files in repositories and workspaces.
This plugin comes packaged with the flint npm package.
Presets
Section titled “Presets”Flint’s package.json plugin provides the following preset:
| Preset | Recommended | Description |
|---|---|---|
logical | ✅ Always | Common rules for finding bugs and good practices in package.json files. |
stylistic | ✅ Always | Common rules for consistent styling and best stylistic practices. |
Flint recommends using the logical and stylistic presets:
import { function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig, const packageJson: Plugin<RuleAbout, "all", []>
packageJson } from "flint";
export default function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig({ ConfigDefinition.use: ConfigUseDefinition[]
Specifies the files to be linted alongside the rules and settings to lint with.
use: [ { ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
A list of glob patterns describing which file(s) to lint.
files: const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.files: Record<"all", FilesValue>
Selectors of files this plugin suggests applying its rules to.
files.all: FilesValue
all, ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
Any number of rules and/or presets of rules to enable for those files.
rules: [const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.presets: PluginPresets<RuleAbout, never>
Preset lists of rules to enable on files.
presets.any
logical, const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.presets: PluginPresets<RuleAbout, never>
Preset lists of rules to enable on files.
presets.any
stylistic], }, ],});logical
Section titled “logical”Rules that find bugs and enforce best practices and prevent common pitfalls for most-to-all package.json files.
import { function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig, const packageJson: Plugin<RuleAbout, "all", []>
packageJson } from "flint";
export default function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig({ ConfigDefinition.use: ConfigUseDefinition[]
Specifies the files to be linted alongside the rules and settings to lint with.
use: [ { ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
A list of glob patterns describing which file(s) to lint.
files: const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.files: Record<"all", FilesValue>
Selectors of files this plugin suggests applying its rules to.
files.all: FilesValue
all, ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
Any number of rules and/or presets of rules to enable for those files.
rules: const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.presets: PluginPresets<RuleAbout, never>
Preset lists of rules to enable on files.
presets.any
logical, }, ],});stylistic
Section titled “stylistic”Rules that enforce consistent styling and best stylistic practices for most-to-all package.json files.
import { function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig, const packageJson: Plugin<RuleAbout, "all", []>
packageJson } from "flint";
export default function defineConfig(definition: ConfigDefinition): Config
Defines a new linter configuration for a Flint config file.
defineConfig({ ConfigDefinition.use: ConfigUseDefinition[]
Specifies the files to be linted alongside the rules and settings to lint with.
use: [ { ConfigUseDefinition.files: AnyLevelDeep<FilesValue>
A list of glob patterns describing which file(s) to lint.
files: const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.files: Record<"all", FilesValue>
Selectors of files this plugin suggests applying its rules to.
files.all: FilesValue
all, ConfigUseDefinition.rules: AnyLevelDeep<ConfigRuleDefinition>
Any number of rules and/or presets of rules to enable for those files.
rules: const packageJson: Plugin<RuleAbout, "all", []>
packageJson.Plugin<RuleAbout, "all", []>.presets: PluginPresets<RuleAbout, never>
Preset lists of rules to enable on files.
presets.any
stylistic, }, ],});Implemented: 0 of 77 (0%)
| Flint Rule | Preset |
|---|---|
attribution | logical |
authorValidity | logical |
binValidity | logical |
bundleDependenciesValidity | logical |
configValidity | logical |
contributorsValidity | logical |
cpuValidity | logical |
dependenciesValidity | logical |
dependencyUniqueness | logical |
descriptionPresence | logical |
descriptionValidity | logical |
devDependenciesValidity | logical |
directoriesValidity | logical |
emptyFields | logical |
enginesValidity | logical |
exportsPresence | logical |
exportsValidity | logical |
filesRedundancy | logical |
filesValidity | logical |
homepageValidity | logical |
keywordsValidity | logical |
licensePresence | logical |
licenseValidity | logical |
manValidity | logical |
moduleValidity | logical |
namePresence | logical |
nameValidity | logical |
optionalDependenciesValidity | logical |
osValidity | logical |
peerDependenciesInstallation | logical |
peerDependenciesValidity | logical |
privateValidity | logical |
propertyOrdering | logical |
publishConfigRedundancy | logical |
publishConfigValidity | logical |
repositoryDirectoryValidity | logical |
repositoryPresence | logical |
repositoryShorthand | logical |
repositoryValidity | logical |
scriptsValidity | logical |
sideEffectsPresence | logical |
sideEffectsValidity | logical |
typePresence | logical |
typeValidity | logical |
versionPresence | logical |
versionValidity | logical |
workspacesValidity | logical |
binNameCasing | stylistic |
exportsSubpathsStyle | stylistic |
scriptsNameCasing | stylistic |
authorPresence | (none) |
binPresence | (none) |
bugsPresence | (none) |
bundleDependenciesPresence | (none) |
configPresence | (none) |
contributorsPresence | (none) |
cpuPresence | (none) |
dependenciesPresence | (none) |
dependencyRanges | (none) |
devDependenciesPresence | (none) |
directoriesPresence | (none) |
enginesPresence | (none) |
filesPresence | (none) |
fundingPresence | (none) |
keywordsPresence | (none) |
mainPresence | (none) |
manPresence | (none) |
modulePresence | (none) |
optionalDependenciesPresence | (none) |
osPresence | (none) |
packageManagerPresence | (none) |
peerDependenciesPresence | (none) |
privatePackageProperties | (none) |
privatePresence | (none) |
publishConfigPresence | (none) |
scriptsPresence | (none) |
typesPresence | (none) |
Selectors
Section titled “Selectors”Flint’s package.json plugin will provide the following files selector:
all:**/package.json