Skip to content

Commit

Permalink
chore(esm): dev environment cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
unicornware committed Sep 28, 2022
1 parent 1b3348f commit dbdaf1a
Showing 31 changed files with 535 additions and 660 deletions.
47 changes: 47 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"defaultIgnores": true,
"extends": ["@commitlint/config-conventional"],
"formatter": "@commitlint/format",
"ignores": [],
"rules": {
"scope-case": [2, "always", "kebab-case"],
"scope-enum": [
2,
"always",
[
"action",
"deps",
"deps-dev",
"github",
"helpers",
"pkg",
"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"
]
]
}
}
58 changes: 0 additions & 58 deletions .commitlintrc.ts

This file was deleted.

2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"dist/",
"yarn.lock"
],
"ignoreRegExpList": [],
"ignoreRegExpList": ["/from\\s+(['\"]).*\\1/"],
"ignoreWords": [],
"language": "en-US",
"patterns": [],
10 changes: 1 addition & 9 deletions .dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ahmadnassri
ardatan
autocrlf
autosetuprebase
@@ -12,7 +11,7 @@ chbfix
chbhotfix
chbrelease
commitlintrc
dawidd6
dawidd
dedupe
dessant
dohm
@@ -27,21 +26,14 @@ iife
keyid
larsgw
lcov
lintstagedrc
micnncim
nocheck
noreply
npmjs
npmrc
nums
nvmrc
pdel
preid
printenv
rickstaa
safecrlf
syncer
tsnode
vates
vitest
vsicons
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
@@ -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
63 changes: 30 additions & 33 deletions .eslintrc.base.cjs
Original file line number Diff line number Diff line change
@@ -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}
@@ -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: [
@@ -44,7 +44,7 @@ const config = {
ResolveHookContext: 'readonly',
ResolveHookResult: 'readonly'
},
parser: require.resolve('@typescript-eslint/parser'),
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx,
@@ -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,
@@ -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,
{
@@ -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,
@@ -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,
@@ -797,19 +797,17 @@ const config = {
}
},
{
files: ['*.cjs', '*.md/*.cjs', '*.mjs'],
files: ['*.cjs', '*.md/*.cjs', '*.js', '*.jsx', '*.mjs'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-implicit-any-catch': 0,
'@typescript-eslint/restrict-template-expressions': 0
'@typescript-eslint/no-implicit-any-catch': 0
}
},
{
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
}
},
{
@@ -818,6 +816,12 @@ const config = {
'no-undef': 0
}
},
{
files: ['*.cts'],
rules: {
'unicorn/prefer-module': 0
}
},
{
files: ['*.d.ts'],
rules: {
@@ -842,15 +846,14 @@ const config = {
}
},
{
files: ['*.json'],
files: ['*.json', '*.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,
@@ -914,24 +917,25 @@ const config = {
pathPattern: '^$'
}
],

'jsonc/valid-json-number': 2,
'jsonc/vue-custom-block/no-parsing-error': 2
}
},
{
files: ['*.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,
@@ -1002,7 +1006,6 @@ const config = {
faker: true,
it: true,
pf: true,
restoreConsole: true,
suite: true,
test: true,
vi: true,
@@ -1028,7 +1031,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,
@@ -1043,15 +1045,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
}
},
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -19,8 +19,13 @@
# TEXT FILE ATTRIBUTES
# ------------------------------------------------------------------------------
*.cjs text eol=lf
*.cts text eol=lf
*.gql text eol=lf
*.hbs text eol=lf
*.json text eol=lf
*.jsonc text eol=lf
*.md text eol=lf diff=markdown
*.mjs text eol=lf
*.sh text eol=lf
*.ts text eol=lf
*.txt text eol=lf
Loading

0 comments on commit dbdaf1a

Please sign in to comment.