Skip to content

Commit

Permalink
feat(presets): add node-fermium entrypoint (for node 14)
Browse files Browse the repository at this point in the history
  • Loading branch information
nelson6e65 committed Oct 11, 2023
1 parent 5f4da1c commit 5659f96
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"require": "./dist/presets/node-erbium.cjs",
"default": "./dist/presets/node-erbium.cjs"
},
"./node-fermium": {
"types": "./dist/presets/node-fermium.d.ts",
"import": "./dist/presets/node-fermium.mjs",
"require": "./dist/presets/node-fermium.cjs",
"default": "./dist/presets/node-fermium.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,7 +40,6 @@ const config: Linter.Config = {
export default config;

// TODO: Create presets for different versions of node
// 14.x Fermium 2020-04-21
// 16.x Gallium 2021-04-20
// 18.x Hydrogen 2023-09-18
// 20.x - 2023-09-28
43 changes: 43 additions & 0 deletions src/presets/node-fermium.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 12 (Erbium)
*/
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: '^14.0.0' }),
},
},
],
};

export default config;

0 comments on commit 5659f96

Please # to comment.