Skip to content

Commit

Permalink
refactor(logtask): downgrade chalk to v4 to fix esm module issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie-BitFlight committed Sep 26, 2023
1 parent 09ed296 commit 56a91dc
Show file tree
Hide file tree
Showing 22 changed files with 5,558 additions and 3,941 deletions.
35 changes: 22 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

[*.ts]
quote_type = double
[{*.ts,*.js}]
quote_type = single
indent_style = space
indent_size = 2

[{Dockerfile,Makefile,*.go,script/add-grammar}]
indent_style = tab
indent_size = 4

# md (GitHub shows code fences with 8 spaces)
[*.md]
max_line_length = off
indent_size = 2
trim_trailing_whitespace = false
x-soft-wrap-text = true
max_line_length = off

root=true
# Ignore fixtures and vendored files
[{grammars,test/fixtures,samples,vendor,dist,build,node_modules,target}/**]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = unset
trim_trailing_spaces = unset

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[{**/dist/**,**/build/**,**/node_modules/**,**/vendor/**,**/target/**}]
indent_style = ignore
Expand All @@ -35,7 +44,7 @@ trim_trailing_whitespace = ignore
# Makefiles always use tabs for indentation
[**/Makefile*]
indent_style = tab
indent_size = 8
indent_size = 4

# Minified JavaScript files shouldn't be changed
[**.min.js]
Expand Down
40 changes: 29 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,32 @@ module.exports = {
env: {
node: true,
es6: true,
browser: false,
},
overrides: [
{
files: ['*.yml', '*.yaml'],
extends: [pp],
},
{
files: ['*.js', '*.cjs'],
files: ['*.js', '*.cjs', '*.jsx'],
plugins: ['editorconfig'],
extends: ['plugin:editorconfig/all', pp],
extends: ['airbnb-base', 'eslint:recommended', 'plugin:editorconfig/all', pp],
rules: {
'no-plusplus': 'off',
'unicorn/prefer-module': 'off',
'no-use-before-define': 'off',
'no-console': 'off',
'sonarjs/cognitive-complexity': 'off',
'camelcase': 'off',
'import/extensions': 'off',
'sonarjs/no-duplicate-string': 'off',
},
parser: '@babel/eslint-parser',
env: { es2022: true, node: true },
parserOptions: {
requireConfigFile: false,
sourceType: 'module',
sourceType: 'script',
ecmaVersion: 'latest',
ecmaFeatures: {
impliedStrict: true,
Expand Down Expand Up @@ -58,16 +62,19 @@ module.exports = {
'simple-import-sort',
'import',
'jest',
'jest-async',
'@typescript-eslint',
'security',
'optimize-regex',
'editorconfig',
'promise',
],
extends: [
'plugin:promise/recommended',
'plugin:no-use-extend-native/recommended',
'plugin:jest/recommended',
'plugin:editorconfig/all',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:security/recommended',
'airbnb-base',
'plugin:import/errors',
'plugin:import/warnings',
Expand All @@ -85,6 +92,7 @@ module.exports = {
tsconfigRootDir: __dirname,
},
rules: {
'jest-async/expect-return': 'error',
'operator-linebreak': ['error', 'after'],
'dot-notation': 'off',
'@typescript-eslint/dot-notation': ['error'],
Expand All @@ -97,6 +105,7 @@ module.exports = {
'error',
{ accessibility: 'no-public' },
],
'import/no-unresolved': 'error',
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/lines-between-class-members': ['error'],
'@typescript-eslint/no-explicit-any': 'off',
Expand All @@ -122,31 +131,26 @@ module.exports = {
'camelcase': 'off',
'consistent-return': 'off',
'eslint-comments/no-use': 'off',
'github/no-then': 'off',
'import/extensions': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-namespace': 'off',
'import/prefer-default-export': 'off',
'import/prefer-default-import': 'off',
'lines-between-class-members': 'off',
'no-console': 'off',
'no-plusplus': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'no-restricted-syntax': 'off',
'one-var': 'off',
'security/detect-non-literal-fs-filename': 'off',
'security/detect-object-injection': 'off',
'semi': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'sort-imports': 'off',
'sonarjs/cognitive-complexity': 'off',
'space-before-function-paren': 'off',
'unicorn/filename-case': 'off',
'unicorn/import': 'off',
'unicorn/import-style': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'off',
Expand All @@ -162,12 +166,26 @@ module.exports = {
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
},
globals: {
NodeJS: true,
},
env: {
'browser': false,
'node': true,
'es6': true,
'es2021': true,
'es2022': true,
'jest/globals': true,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
},
},
},
},
],
};
File renamed without changes.
18 changes: 10 additions & 8 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ actions:
plugins:
sources:
- id: trunk
ref: v0.0.3
ref: v0.0.5
uri: https://github.com/trunk-io/plugins
cli:
version: 0.18.1-beta
version: 1.0.1
lint:
disabled:
- git-diff-check
enabled:
- [email protected]
- [email protected]
- git-diff-check@SYSTEM
- gitleaks@8.9.0
- markdownlint@0.31.1
- prettier@2.6.2
- [email protected]
- [email protected]
- [email protected]
- gitleaks@8.15.0
- markdownlint@0.32.2
- prettier@2.7.1
- [email protected]
- [email protected]
ignore:
Expand Down
5 changes: 2 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ const config: Config.InitialOptions = {
testEnvironment: 'node',
testMatch: ['**/__tests__/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest',
},

preset: 'ts-jest',
setupFiles: ['dotenv/config'],
reporters: ['default', 'jest-junit'],
testPathIgnorePatterns: ['/helpers/', '/node_modules/'],
Expand Down
Loading

0 comments on commit 56a91dc

Please sign in to comment.