diff --git a/package-lock.json b/package-lock.json index abc45f3..3cf9ed1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2581,6 +2581,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2699,6 +2700,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2729,6 +2731,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "peer": true, "engines": { "node": ">=8" } @@ -2854,7 +2857,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "peer": true }, "node_modules/config-chain": { "version": "1.1.13", @@ -4098,6 +4102,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4315,7 +4320,8 @@ "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "peer": true }, "node_modules/http-proxy-agent": { "version": "7.0.0", @@ -5249,6 +5255,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5757,6 +5764,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "peer": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -5768,6 +5776,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "peer": true, "bin": { "semver": "bin/semver" } @@ -9471,6 +9480,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -10954,7 +10964,8 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "peer": true }, "node_modules/through": { "version": "2.3.8", diff --git a/package.json b/package.json index 134c743..9f705d0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,12 @@ "require": "./dist/presets/node-fermium.cjs", "default": "./dist/presets/node-fermium.cjs" }, + "./node-gallium": { + "types": "./dist/presets/node-gallium.d.ts", + "import": "./dist/presets/node-gallium.mjs", + "require": "./dist/presets/node-gallium.cjs", + "default": "./dist/presets/node-gallium.cjs" + }, "./rules": { "types": "./dist/rules/index.d.ts", "import": "./dist/rules/index.mjs", diff --git a/src/presets/default.ts b/src/presets/default.ts index 47fa371..ec8b048 100644 --- a/src/presets/default.ts +++ b/src/presets/default.ts @@ -40,6 +40,5 @@ const config: Linter.Config = { export default config; // TODO: Create presets for different versions of node -// 16.x Gallium 2021-04-20 // 18.x Hydrogen 2023-09-18 // 20.x - 2023-09-28 diff --git a/src/presets/node-erbium.ts b/src/presets/node-erbium.ts index 62adcf2..d48c5d2 100644 --- a/src/presets/node-erbium.ts +++ b/src/presets/node-erbium.ts @@ -3,7 +3,7 @@ import { Linter } from 'eslint'; import { baseRules, getImportRules, getNodeRules } from '~/rules'; /** - * Config for Node.js 12 (Erbium) + * Config for Node.js 12 (Erbium). */ const config: Linter.Config = { overrides: [ diff --git a/src/presets/node-fermium.ts b/src/presets/node-fermium.ts index b840008..594b6a1 100644 --- a/src/presets/node-fermium.ts +++ b/src/presets/node-fermium.ts @@ -3,7 +3,7 @@ import { Linter } from 'eslint'; import { baseRules, getImportRules, getNodeRules } from '~/rules'; /** - * Config for Node.js 12 (Erbium) + * Config for Node.js 14 (Fermium). */ const config: Linter.Config = { overrides: [ diff --git a/src/presets/node-gallium.ts b/src/presets/node-gallium.ts new file mode 100644 index 0000000..b16e672 --- /dev/null +++ b/src/presets/node-gallium.ts @@ -0,0 +1,43 @@ +import { Linter } from 'eslint'; + +import { baseRules, getImportRules, getNodeRules } from '~/rules'; + +/** + * Config for Node.js 16 (Gallium). + */ +const config: Linter.Config = { + overrides: [ + { + files: ['*.js', '*.mjs', '*.cjs'], + parserOptions: { + ecmaVersion: 'latest', + }, + extends: [ + // + 'eslint:recommended', + 'plugin:node/recommended', + 'plugin:import/recommended', + 'plugin:unicorn/recommended', + 'prettier', + ], + plugins: [ + // + 'node', + 'import', + 'unicorn', + ], + rules: { + ...baseRules, + ...getImportRules({ + pathsGroups: [ + { group: 'internal', pattern: '@/**' }, + { group: 'internal', pattern: '~/**' }, + ], + }), + ...getNodeRules({ nodeVersionRange: '^16.0.0' }), + }, + }, + ], +}; + +export default config;