trevorr / tsfv

Typescript Fluent Validation Library
ISC License
5 stars 0 forks source link

Getting a lot of circularly references issues when building a vuejs project. #3

Open avioli opened 4 years ago

avioli commented 4 years ago
 error  in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts

ERROR in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts(162,21):
162:21 Type alias 'NumericValidation' circularly references itself.
    160 |  * Mix-in type for non-inverted validation builders that apply to numeric values.
    161 |  */
  > 162 | export declare type NumericValidation = NumericValidationReturning<NumericValidation & Validator>;
        |                     ^
    163 | /**
    164 |  * Mix-in interface for building validators that apply to types with a length, such as strings and arrays.
    165 |  * @typeparam V return type for each rule builder method

 error  in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts

ERROR in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts(225,21):
225:21 Type alias 'StringValidation' circularly references itself.
    223 |  * Mix-in type for non-inverted validation builders that apply to strings.
    224 |  */
  > 225 | export declare type StringValidation = StringValidationReturning<StringValidation & Validator>;
        |                     ^
    226 | /**
    227 |  * Mix-in interface for building validators that apply to arrays.
    228 |  * @typeparam V return type for each rule builder method

 error  in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts

ERROR in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts(253,21):
253:21 Type alias 'ArrayValidation' circularly references itself.
    251 |  * Mix-in type for non-inverted validation builders that apply to arrays.
    252 |  */
  > 253 | export declare type ArrayValidation = ArrayValidationReturning<ArrayValidation & Validator>;
        |                     ^
    254 | /**
    255 |  * Mix-in interface for building validators that apply to objects.
    256 |  * @typeparam V return type for each rule builder method

 error  in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts

ERROR in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/api.d.ts(281,21):
281:21 Type alias 'ObjectValidation' circularly references itself.
    279 |  * Mix-in type for non-inverted validation builders that apply to objects.
    280 |  */
  > 281 | export declare type ObjectValidation = ObjectValidationReturning<ObjectValidation & Validator>;
        |                     ^
    282 | /**
    283 |  * Mix-in interface for building validators that validate types
    284 |  * and narrow the set of available validation methods accordingly.

 error  in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/Validation.d.ts

ERROR in /Users/avioli/Projects/eTVS/spa-survey-builder/node_modules/tsfv/dist/Validation.d.ts(16,9):
16:9 An accessor cannot be declared in an ambient context.
    14 |     string(): this;
    15 |     undefined(): this;
  > 16 |     get not(): Validation;
       |         ^
    17 |     anyOf(...validators: Validator[]): this;
    18 |     equal(value: any): this;
    19 |     exact(value: any): this;
avioli commented 4 years ago

Using "typescript": "^3.5.3", (resolved to 3.5.3)

My tsconfig.json:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": ["webpack-env", "vuetify"],
    "paths": {
      "@/*": ["src/*"]
    },
    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": ["node_modules"]
}
trevorr commented 4 years ago

Could you try using Typescript 3.7 or later?