Skip to content

Commit

Permalink
replace eslint-plugin-node with eslint-plugin-n & update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Aug 18, 2023
1 parent 241c597 commit bf3558d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 128 deletions.
4 changes: 2 additions & 2 deletions InReach.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
"eslint.options": {
"cache": true
},
"eslint.ignoreUntitled": true,
"eslint.nodeEnv": "development",
"eslint.rules.customizations": [
{
"rule": "import/order",
Expand All @@ -160,9 +162,7 @@
},
{ "rule": "sort-imports", "severity": "off" }
],
"eslint.runtime": "node",
"eslint.useESLintClass": true,
"eslint.workingDirectories": [{ "pattern": "./packages/*/" }, { "pattern": "./apps/*/" }],
"explorer.decorations.badges": true,
"explorer.expandSingleFolderWorkspaces": false,
"explorer.fileNesting.enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"chokidar": ">=3.0.0",
"csstype": "^3.1.2",
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
"eslint-plugin-node": "npm:eslint-plugin-n@latest",
"glob-parent@<5.1.2": "^5.1.2",
"http-cache-semantics@<=4.1.0": "^4.1.1",
"listr2@<5": "^5.0.5",
Expand All @@ -91,7 +92,6 @@
},
"patchedDependencies": {
"@crowdin/[email protected]": "patches/@[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/config/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "es2017"
"target": "es2020"
},
"display": "Default",
"include": ["../../@types/**/*.ts"],
Expand Down
26 changes: 20 additions & 6 deletions packages/eslint-config/base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-unused-modules */
/** @type {import('eslint').ESLint.ConfigData} */
const config = {
plugins: ['codegen', 'turbo', 'node', /*'import',*/ '@tanstack/query'],
Expand All @@ -12,6 +11,10 @@ const config = {
'prettier',
],
rules: {
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' },
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
Expand All @@ -32,7 +35,11 @@ const config = {
],
'@typescript-eslint/no-empty-function': 'off',
'no-duplicate-imports': 'off',
'node/no-deprecated-api': 'error',
'node/no-process-env': 'warn',
'node/no-unsupported-features/es-builtins': 'error',
'node/no-unsupported-features/es-syntax': 'error',
'node/no-unsupported-features/node-builtins': 'error',
'codegen/codegen': 'error',
'react/jsx-key': 'off',
'react/no-unescaped-entities': 'off',
Expand Down Expand Up @@ -103,21 +110,28 @@ const config = {
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./packages/*/tsconfig.json', './apps/*/tsconfig.json', './tsconfig.json'],
EXPERIMENTAL_useProjectService: true,
// project: [ './packages/*/tsconfig.json', './apps/*/tsconfig.json', './tsconfig.json' ],
emitDecoratorMetadata: true,
ecmaVersion: 2020,
},
ignorePatterns: ['!.*', 'node_modules', 'dist/', '.next/'],
settings: {
'import/cache': {
lifetime: 60,
},
'import/extensions': ['.js', '.jsx', '.cjs', '.mjs', '.ts', '.mts', '.tsx'],
'import/internal-regex': '^(?:(?:@weareinreach\\/)|(?:~\\w*\\/)).*',
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.mts'],
},
'import/resolver': {
node: true,
typescript: {
alwaysTryTypes: true,
project: ['./packages/*/tsconfig.json', './apps/*/tsconfig.json', './tsconfig.json'],
},
},
'import/cache': {
lifetime: 10,
},
'import/internal-regex': '^(?:(?:@weareinreach\\/)|(?:~\\w*\\/)).*',
},
env: {
node: true,
Expand Down
81 changes: 0 additions & 81 deletions patches/[email protected]

This file was deleted.

55 changes: 18 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf3558d

Please sign in to comment.