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,
const config = Object.assign({}, require('./base'))
if (isPkgAvailable('eslint')) {
Object.assign(
config,
{
'*.{js,jsx,md,mdx,mjs,vue}': [
'eslint --cache -f friendly --fix',
'git add',
],
},
require('./ts-eslint'),
)
}
if (isPkgAvailable('tslint') && tryFile('tslint.json')) {
Object.assign(config, require('./ts-tslint'))
}
module.exports = config
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,
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),
tryFile('node_modules/@types', true),
].filter(Boolean),
tryExtensions: [
'.ts',
'.tsx',
'.d.ts',
'.vue',
'.mjs',
'.js',
'.jsx',
'.json',
'.node',
'.mdx',
],
},
}
ignoreDestructuring: true,
},
],
'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: [
{
properties: 'never',
ignoreDestructuring: true,
},
],
'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,
},
},
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),
tryFile('node_modules/@types', true),
].filter(Boolean),
tryExtensions: [
'.ts',
'.tsx',
'.d.ts',
'.vue',
'.mjs',
'.js',
'.jsx',
'.json',
'.node',
'.mdx',
],
},
}
const { resolve } = require('path')
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,