Skip to content

Commit

Permalink
🚧 add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
dudeofawesome committed Oct 3, 2023
1 parent 5288a0d commit 4050e18
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions eslint-config-cli/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ extends:
rules:
# allow scripts to log simply
no-console: 'off'

# allow scripts to exit
n/no-process-exit: 'off'
15 changes: 15 additions & 0 deletions eslint-config-node/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,59 @@ env:

# plugin:n/recommended-module disables some globals we still want
globals:
# TODO: detect if project is type: module or not and remove the globals if so
__dirname: 'readonly'
__filename: 'readonly'
require: 'readonly'

rules:
# node has a consistent radix for parseInt
radix: 'off'

# we should be reading any env config into a specific config module
n/no-process-env: 'error'

# enforce return upon a callback
n/callback-return: ['error', ['callback', 'cb', 'next']]

# disallow require() outside of the top-level module scope
n/global-require: 'error'

# enforces error handling in callbacks
n/handle-callback-err: ['error', '^.*[eE]rr(or)?$']

# disallow mixing regular variable and require declarations
n/no-mixed-requires: 'error'

# disallow use of new operator with the require function
n/no-new-require: 'error'

# disallow string concatenation with __dirname and __filename
n/no-path-concat: 'error'

# restrict usage of specified node modules
n/no-restricted-import: 'off'
n/no-restricted-require: 'off'

# disallow use of synchronous methods
n/no-sync: 'error'

# defer to import/no-extraneous-dependencies
n/no-extraneous-import: 'off'
n/no-extraneous-require: 'off'

# use `module.exports` for commonjs
n/exports-style: ['error', 'module.exports']

# use imports instead of globals
n/prefer-global/text-decoder: ['error', 'never']
n/prefer-global/text-encoder: ['error', 'never']
n/prefer-global/url-search-params: ['error', 'never']
n/prefer-global/url: ['error', 'never']

# use promise APIs
n/prefer-promises/dns: 'error'
n/prefer-promises/fs: 'error'

# make sure callbacks pass error as 1st param
n/no-callback-literal: 'error'
10 changes: 8 additions & 2 deletions typescript-configs/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"allowSyntheticDefaultImports": true,
"target": "es2022",
"sourceMap": true,
"outDir": "./dist",
// TODO: I guess I can't set dirs?
// "outDir": "./dist",

// config
"baseUrl": "./",
// TODO: I guess I can't set dirs?
// "baseUrl": "./",
"noFallthroughCasesInSwitch": false,
"esModuleInterop": true,
// "verbatimModuleSyntax": true, // TODO: what is this?
Expand All @@ -37,4 +39,8 @@
"useUnknownInCatchVariables": true,
"noUncheckedIndexedAccess": true // TODO: can we actually do this?
}
// TODO: I guess I can't set dirs?
// "include": ["src/"],
// TODO: I guess I can't set dirs?
// "exclude": ["dist/"]
}

0 comments on commit 4050e18

Please sign in to comment.