Skip to content

Commit

Permalink
refactor(eslint): move eslint, `@typescript-eslint/typescript-estre…
Browse files Browse the repository at this point in the history
…e` to peerDependencies
  • Loading branch information
johnsoncodehk committed Nov 4, 2024
1 parent 372a35a commit d1dea9a
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 146 deletions.
16 changes: 6 additions & 10 deletions packages/eslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ import type * as ESLint from 'eslint';
import type * as ts from 'typescript';

import ScopeManager = require('@typescript-eslint/scope-manager');
import path = require('path');
import eslint = require('eslint');

const estreeModuleDir = path.dirname(require.resolve('@typescript-eslint/typescript-estree/package.json'));
const eslintModuleDir = path.dirname(require.resolve('eslint/package.json'));

// TS-ESLint internal scripts
const astConverter = require(path.resolve(estreeModuleDir, 'dist', 'ast-converter.js')).astConverter;
const createParserServices = require(path.resolve(estreeModuleDir, 'dist', 'createParserServices.js')).createParserServices;
const createParseSettings = require(path.resolve(estreeModuleDir, 'dist', 'parseSettings', 'createParseSettings.js')).createParseSettings;
const astConverter = require('./node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js').astConverter;
const createParserServices = require('./node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js').createParserServices;
const createParseSettings = require('./node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js').createParseSettings;

// ESLint internal scripts
const createEmitter = require(path.resolve(eslintModuleDir, 'lib', 'linter', 'safe-emitter.js'));
const NodeEventGenerator = require(path.resolve(eslintModuleDir, 'lib', 'linter', 'node-event-generator.js'));
const Traverser = require(path.resolve(eslintModuleDir, 'lib', 'shared', 'traverser.js'));
const createEmitter = require('./node_modules/eslint/lib/linter/safe-emitter.js');
const NodeEventGenerator = require('./node_modules/eslint/lib/linter/node-event-generator.js');
const Traverser = require('./node_modules/eslint/lib/shared/traverser.js');

const estrees = new WeakMap<ts.SourceFile, {
estree: any;
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"typescript": "latest"
},
"dependencies": {
"@typescript-eslint/scope-manager": "^7.16.1",
"@typescript-eslint/scope-manager": "^7.16.1"
},
"peerDependencies": {
"@typescript-eslint/typescript-estree": "^7.16.1",
"eslint": "^9.0.0"
}
Expand Down
Loading

0 comments on commit d1dea9a

Please sign in to comment.