Skip to content

Commit

Permalink
chore: prep for pure esm migration
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Sep 28, 2022
1 parent 8e00957 commit eba6975
Show file tree
Hide file tree
Showing 36 changed files with 640 additions and 684 deletions.
56 changes: 56 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"defaultIgnores": true,
"extends": ["@commitlint/config-conventional"],
"formatter": "@commitlint/format",
"ignores": [],
"rules": {
"scope-case": [2, "always", "kebab-case"],
"scope-enum": [
2,
"always",
[
"cjs",
"cli",
"deps",
"deps-dev",
"deps-opt",
"deps-peer",
"esm",
"exports",
"github",
"helpers",
"hybrid",
"node",
"options",
"pkg",
"publish",
"release",
"scripts",
"tests",
"ts",
"vscode",
"workflows",
"yarn"
]
],
"subject-case": [1, "always", "lower-case"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"wip"
]
]
}
}
67 changes: 0 additions & 67 deletions .commitlintrc.ts

This file was deleted.

2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"CHANGELOG.md",
"LICENSE.md",
"__tests__/report.json",
"dist/",
"patches/",
"yarn.lock"
],
"ignoreRegExpList": [],
Expand Down
5 changes: 0 additions & 5 deletions .dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ahmadnassri
ardatan
autocrlf
autosetuprebase
Expand Down Expand Up @@ -32,16 +31,12 @@ lintstagedrc
micnncim
mkdist
nocheck
noreply
npmjs
npmrc
nums
nvmrc
ohmyzsh
pdel
pkgs
preid
rickstaa
safecrlf
syncer
tsnode
Expand Down
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ indent_style = 'space'
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

# handlebars
[*.hbs]
max_line_length = 100

# shellscript
[*.sh]
max_line_length = 100

# snapshots
[*.snap]
max_line_length = 130

# yaml
[*.yml]
max_line_length = 100
7 changes: 0 additions & 7 deletions .env.test

This file was deleted.

3 changes: 0 additions & 3 deletions .env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@
# - https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv

NODE_NO_WARNINGS=1
NODE_OPTIONS='--es-module-specifier-resolution=node'
PROJECT_CWD=$(node -e "console.log(path.resolve('.'))")
TS_NODE_PROJECT=$PROJECT_CWD/tsconfig.tsnode.json
VITEST_SEGFAULT_RETRY=3
57 changes: 28 additions & 29 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

/**
* @type {import('tsconfig.json')}
* @type {typeof import('./tsconfig.json')}
* @const tsconfig - Tsconfig object
*/
const tsconfig = require('tsconfig/dist/tsconfig').loadSync(__dirname).config
const tsconfig = require('./tsconfig.json')

/**
* @type {boolean}
Expand All @@ -22,7 +22,7 @@ const jsx = Boolean(tsconfig.compilerOptions.jsx)
*/
const config = {
env: {
[tsconfig.compilerOptions.target]: true,
[require('./tsconfig.build.json').compilerOptions.target]: true,
node: true
},
extends: [
Expand All @@ -44,7 +44,7 @@ const config = {
ResolveHookContext: 'readonly',
ResolveHookResult: 'readonly'
},
parser: require.resolve('@typescript-eslint/parser'),
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx,
Expand Down Expand Up @@ -120,9 +120,10 @@ const config = {
{
allowArgumentsExplicitlyTypedAsAny: true,
allowDirectConstAssertionInArrowFunctions: true,
allowHigherOrderFunctions: true,
allowHigherOrderFunctions: false,
allowTypedFunctionExpressions: true,
allowedNames: []
allowedNames: [],
shouldTrackReferences: true
}
],
'@typescript-eslint/init-declarations': 0,
Expand Down Expand Up @@ -191,7 +192,7 @@ const config = {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-extra-non-null-assertion': 2,
'@typescript-eslint/no-extra-parens': 0,
'@typescript-eslint/no-extra-semi': 2,
'@typescript-eslint/no-extra-semi': 0,
'@typescript-eslint/no-extraneous-class': [
2,
{
Expand Down Expand Up @@ -490,7 +491,7 @@ const config = {
'node/no-new-require': 2,
'node/no-path-concat': 2,
'node/no-process-env': 0,
'node/no-process-exit': 2,
'node/no-process-exit': 0,
'node/no-unpublished-bin': 0,
'node/no-unpublished-import': 0,
'node/no-unpublished-require': 0,
Expand Down Expand Up @@ -530,7 +531,6 @@ const config = {
'unicorn/better-regex': [2, { sortCharacterClasses: true }],
'unicorn/catch-error-name': [2, { name: 'e' }],
'unicorn/consistent-destructuring': 2,
'unicorn/consistent-function-scoping': 2,
'unicorn/custom-error-definition': 2,
'unicorn/empty-brace-spaces': 2,
'unicorn/error-message': 2,
Expand Down Expand Up @@ -808,8 +808,7 @@ const config = {
files: ['*.cjs', '*.cts'],
rules: {
'@typescript-eslint/no-require-imports': 0,
'@typescript-eslint/no-var-requires': 0,
'unicorn/prefer-module': 0
'@typescript-eslint/no-var-requires': 0
}
},
{
Expand All @@ -818,6 +817,12 @@ const config = {
'no-undef': 0
}
},
{
files: ['*.cts'],
rules: {
'unicorn/prefer-module': 0
}
},
{
files: ['*.d.ts'],
rules: {
Expand All @@ -842,15 +847,14 @@ const config = {
}
},
{
files: ['*.json'],
files: ['*.json', '*.json5', '*.jsonc'],
extends: ['plugin:jsonc/prettier'],
parser: require.resolve('jsonc-eslint-parser'),
parser: 'jsonc-eslint-parser',
plugins: ['jsonc'],
rules: {
'jsonc/no-bigint-literals': 2,
'jsonc/no-binary-expression': 2,
'jsonc/no-binary-numeric-literals': 2,
'jsonc/no-comments': 2,
'jsonc/no-escape-sequence-in-identifier': 2,
'jsonc/no-hexadecimal-numeric-literals': 2,
'jsonc/no-infinity': 2,
Expand Down Expand Up @@ -914,24 +918,25 @@ const config = {
pathPattern: '^$'
}
],

'jsonc/valid-json-number': 2,
'jsonc/vue-custom-block/no-parsing-error': 2
}
},
{
files: ['*.json5', '*.jsonc'],
rules: {
'jsonc/no-comments': 0
}
},
{
files: ['*.md'],
parser: require.resolve('eslint-plugin-markdownlint/parser'),
parser: 'eslint-plugin-markdownlint/parser',
plugins: ['markdown', 'markdownlint'],
processor: 'markdown/markdown',
rules: Object.entries(require('./.markdownlint.cjs')).reduce((acc, e) => {
if (/^md\d+/i.test(e[0])) acc[`markdownlint/${e[0]}`] = [1, e[1]]
return acc
}, {})
processor: 'markdown/markdown'
},
{
files: ['*.yml'],
parser: require.resolve('yaml-eslint-parser'),
parser: 'yaml-eslint-parser',
plugins: ['yml'],
rules: {
'prettier/prettier': 0,
Expand Down Expand Up @@ -1027,7 +1032,6 @@ const config = {
'promise/prefer-await-to-callbacks': 0,
'promise/valid-params': 0,
'unicorn/consistent-destructuring': 0,
'unicorn/consistent-function-scoping': 0,
'unicorn/explicit-length-check': 0,
'unicorn/no-array-for-each': 0,
'unicorn/prefer-at': 0,
Expand All @@ -1042,15 +1046,10 @@ const config = {
'unicorn/no-keyword-prefix': 0
}
},
{
files: ['.eslintrc.*', '.lintstagedrc.cjs'],
rules: {
'sort-keys': 0
}
},
{
files: ['.eslintrc.*'],
rules: {
'sort-keys': 0,
'unicorn/string-content': 0
}
},
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/**
* @type {import('eslint').Linter.Config}
* @type {typeof import('eslint').Linter.Config}
* @const config - ESLint configuration object
*/
const config = {
Expand All @@ -16,7 +16,7 @@ const config = {
{
files: ['src/cli.ts'],
rules: {
'node/no-process-exit': 0
'unicorn/no-process-exit': 0
}
},
{
Expand Down
Loading

0 comments on commit eba6975

Please sign in to comment.