我正在使用它构建一个网站create-react-app,并且刚刚安装了eslint它。
由于某种原因,本应显示为 eslint 警告的内容却显示为错误并导致npm run start失败。
我怎样才能绕过这个问题并像以前一样将它们显示为警告?
我的 .eslintrc.js
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'prettier/react',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'class-methods-use-this': 'off',
'additional-rule': 'warn',
},
ignorePatterns: ['**/node_modules/*', '**/build/*', 'config-overrides.js'],
};
Run Code Online (Sandbox Code Playgroud)
我的package.json
"name": "device-protection-renewal-web",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行一些数据库迁移,但我不断收到以下错误:
DatabaseError [SequelizeDatabaseError]: type "public.enum_companies_accountingSwStatus" does not exist
我在另一个项目中也做了同样的事情,没有出现这个问题。
这真的很困扰我,因为我在同一个表中使用 ENUMS 还有其他列,并且它们似乎工作正常。所以我不确定问题出在哪里。
这是我的文件:
公司.model.ts
const {
employeeSize,
revenueClass,
accountingSwStatus,
accountingSwType,
paymentFreq,
freeTrial,
} = enums.Company;
class Company extends Model {
public id!: number;
public employeeSize!: Enumerator;
public revenueClass!: Enumerator;
public accountingSwStatus!: Enumerator;
public accountingSwType!: Enumerator;
public static initModel(sequelize: Sequelize): void {
Company.init(
{
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
// works fine
employeeSize: {
type: DataTypes.ENUM,
values: getValues(employeeSize),
},
// works fine
revenueClass: {
type: DataTypes.ENUM,
values: …Run Code Online (Sandbox Code Playgroud)