Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.dTs = {
files: '*.d.ts',
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-extraneous-class': 0,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/no-unused-vars': 0,
'import/no-duplicates': 0,
'import/order': 0,
'node/no-extraneous-import': 0,
},
}
const TSLINT_CONFIG = tryFile(resolve('tslint.json'))
const lintFile = TSLINT_CONFIG || tryPkg('@1stg/tslint-config')
exports.tslint = {
files: '*.{ts,tsx}',
excludedFiles: '*.d.ts',
plugins: TSLINT_CONFIG ? ['@typescript-eslint/tslint'] : undefined,
rules: Object.assign(
{
// `ordered-imports` of tslint is better for now
'import/order': 0,
},
TSLINT_CONFIG
? undefined
: {
'@typescript-eslint/tslint/config': [
2,
{
},
],
'babel/new-cap': 2,
'babel/no-invalid-this': 2,
'babel/no-unused-expressions': 2,
'babel/valid-typeof': 2,
},
}
exports.js = jsBase
const project =
tryFile(resolve('tsconfig.eslint.json')) ||
tryFile(resolve('tsconfig.base.json')) ||
tryFile(resolve('tsconfig.json')) ||
tryPkg('@1stg/tsconfig')
const resolveSettings = {
'import/external-module-folders': [
'node_modules',
'node_modules/@d-ts',
'node_modules/@types',
],
'import/resolver': {
ts: {
alwaysTryTypes: true,
directory: project,
},
},
node: {
resolvePaths: [
tryFile('node_modules/@d-ts', true),
const {
isAngularAvailable,
isReactAvailable,
isPkgAvailable,
isTsAvailable,
isVueAvailable,
tryFile,
tryPkg,
} = require('@pkgr/utils')
const { camelCaseRule, magicNumbers } = require('./_util')
const configFile =
tryFile(resolve('babel.config.js')) ||
tryFile(resolve('.babelrc.js')) ||
tryPkg('@1stg/babel-preset/config')
const jsBase = {
files: '*.{mjs,js,jsx}',
parser: 'babel-eslint',
parserOptions: configFile && {
babelOptions: {
configFile,
},
},
plugins: ['babel'],
rules: {
camelcase: 0,
'new-cap': 0,
'no-invalid-this': 0,
'no-unused-expressions': 0,
'valid-typeof': 0,