UNPKG

@praha/eslint-config-common

Version:
195 lines (194 loc) 7.76 kB
import eslint_plugin_jsonc from "eslint-plugin-jsonc"; const jsonConfigurator = ()=>[ { name: 'jsonc/recommended-with-json', ...Object.assign({}, ...eslint_plugin_jsonc.configs["flat/recommended-with-json"]) }, { name: 'praha/common/json/sort-package-json', files: [ '**/package.json' ], rules: { 'jsonc/sort-keys': [ 'error', { order: [ '$schema', 'name', 'displayName', 'version', 'private', "description", 'categories', 'keywords', 'homepage', 'bugs', 'repository', 'funding', 'license', 'qna', 'author', 'maintainers', 'contributors', 'publisher', 'sideEffects', 'type', 'imports', 'exports', 'main', 'svelte', 'umd:main', 'jsdelivr', 'unpkg', 'module', 'source', 'jsnext:main', 'browser', 'react-native', 'types', 'typesVersions', 'typings', 'style', 'example', 'examplestyle', 'assets', 'bin', 'man', 'directories', 'files', 'workspaces', 'binary', "scripts", 'betterScripts', 'contributes', 'activationEvents', 'husky', 'simple-git-hooks', 'pre-commit', 'commitlint', 'lint-staged', 'nano-staged', 'config', 'nodemonConfig', 'browserify', 'babel', 'browserslist', 'xo', 'prettier', 'eslintConfig', 'eslintIgnore', 'npmpkgjsonlint', 'npmPackageJsonLintConfig', 'npmpackagejsonlint', 'release', 'remarkConfig', 'stylelint', 'ava', 'jest', 'jest-junit', 'jest-stare', 'mocha', 'nyc', 'c8', 'tap', 'oclif', 'resolutions', 'dependencies', 'devDependencies', 'dependenciesMeta', 'peerDependencies', 'peerDependenciesMeta', 'optionalDependencies', 'bundledDependencies', 'bundleDependencies', 'extensionPack', 'extensionDependencies', 'flat', 'packageManager', 'engines', 'engineStrict', 'volta', 'languageName', 'os', 'cpu', 'preferGlobal', 'publishConfig', 'icon', 'badges', 'galleryBanner', 'preview', 'markdown', 'pnpm' ], pathPattern: '^$' }, { order: [ 'url', 'email' ], pathPattern: '^bugs$' }, { order: [ 'type', 'url' ], pathPattern: '^(?:repository|funding|license)$' }, { order: [ 'name', 'email', 'url' ], pathPattern: '^(?:author|maintainers.*|contributors.*)$' }, { order: { type: 'asc' }, pathPattern: '^(?:bin|contributes|commitlint|config|nodemonConfig|browserify|babel|browserslist|xo|npmpkgjsonlint|npmPackageJsonLintConfig|npmpackagejsonlint|release|remarkConfig|ava|jest|jest-junit|jest-stare|mocha|nyc|c8|tap|oclif|oclif.*|resolutions|dependencies|devDependencies|dependenciesMeta|dependenciesMeta.*|peerDependencies|peerDependenciesMeta.*|optionalDependencies|engines|engineStrict|preferGlobal|publishConfig|galleryBanner)$' }, { order: [ 'lib', 'bin', 'man', 'doc', 'example', 'test' ], pathPattern: '^directories$' }, { order: [ 'module_name', 'module_path', 'remote_path', 'package_name', 'host' ], pathPattern: '^binary$' }, { order: { type: 'asc' }, pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$' } ], 'jsonc/sort-array-values': [ 'error', { order: { type: 'asc' }, pathPattern: '^(?:bundledDependencies|bundleDependencies|extensionPack|extensionDependencies)$' } ] } } ]; export { jsonConfigurator };