Skip to content

Commit

Permalink
feat(presets): add node-gallium entrypoint (for node 16)
Browse files Browse the repository at this point in the history
  • Loading branch information
nelson6e65 committed Oct 11, 2023
1 parent 7bed67a commit f1df35f
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 6 deletions.
17 changes: 14 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/presets/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/presets/node-erbium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion src/presets/node-fermium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
43 changes: 43 additions & 0 deletions src/presets/node-gallium.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f1df35f

Please sign in to comment.