Skip to content

Commit

Permalink
Merge 8814542 into 72f2286
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Nov 10, 2020
2 parents 72f2286 + 8814542 commit 78f67b5
Show file tree
Hide file tree
Showing 371 changed files with 21,321 additions and 19,377 deletions.
2 changes: 0 additions & 2 deletions .codeclimate.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,30 @@
const jsConfig = require("@ajv-validator/config/.eslintrc_js")
const tsConfig = require("@ajv-validator/config/.eslintrc")

module.exports = {
env: {
es6: true,
node: true,
},
overrides: [
jsConfig,
{
...tsConfig,
files: ["*.ts"],
rules: {
...tsConfig.rules,
complexity: ["error", 17],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/no-invalid-this": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/restrict-template-expressions": "off",
},
},
],
}
29 changes: 0 additions & 29 deletions .eslintrc.yml

This file was deleted.

15 changes: 2 additions & 13 deletions .github/ISSUE_TEMPLATE.md
@@ -1,5 +1,5 @@
<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
Please provide all info and reduce your schema and data to the smallest possible size.
This template is for bug or error reports. For other issues please use:
Expand All @@ -12,38 +12,30 @@ This template is for bug or error reports. For other issues please use:

**What version of Ajv are you using? Does the issue happen if you use the latest version?**



**Ajv options object**

<!-- See https://github.com/ajv-validator/ajv#options -->
<!-- See https://github.com/ajv-validator/ajv/api.md#options -->

```javascript


```


**JSON Schema**

<!-- Please make it as small as possible to reproduce the issue -->

```json


```


**Sample data**

<!-- Please make it as small as posssible to reproduce the issue -->

```json


```


**Your code**

<!--
Expand All @@ -59,10 +51,8 @@ Thank you!

```javascript


```


**Validation result, data AFTER validation, error messages**

```
Expand All @@ -72,5 +62,4 @@ Thank you!

**What results did you expect?**


**Are you going to resolve the issue?**
23 changes: 5 additions & 18 deletions .github/ISSUE_TEMPLATE/bug-or-error-report.md
@@ -1,14 +1,13 @@
---
name: Bug or error report
about: Please use for issues related to incorrect validation behaviour
title: ''
labels: 'bug report'
assignees: ''

title: ""
labels: "bug report"
assignees: ""
---

<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
Please provide all info and reduce your schema and data to the smallest possible size.
This template is for bug or error reports.
Expand All @@ -17,38 +16,30 @@ For other issues please see https://github.com/ajv-validator/ajv/blob/master/CON

**What version of Ajv are you using? Does the issue happen if you use the latest version?**



**Ajv options object**

<!-- See https://github.com/ajv-validator/ajv#options -->
<!-- See https://github.com/ajv-validator/ajv/api.md/api.md#options -->

```javascript


```


**JSON Schema**

<!-- Please make it as small as possible to reproduce the issue -->

```json


```


**Sample data**

<!-- Please make it as small as posssible to reproduce the issue -->

```json


```


**Your code**

<!--
Expand All @@ -64,18 +55,14 @@ Thank you!

```javascript


```


**Validation result, data AFTER validation, error messages**

```
```

**What results did you expect?**


**Are you going to resolve the issue?**
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/change.md
@@ -1,14 +1,13 @@
---
name: Feature or change proposal
about: For proposals of new features, options or some other improvements
title: ''
labels: 'enhancement'
assignees: ''

title: ""
labels: "enhancement"
assignees: ""
---

<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
Please provide all info and reduce your schema and data to the smallest possible size.
This template is for change proposals.
Expand Down
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/compatibility.md
@@ -1,14 +1,13 @@
---
name: Browser and compatibility issue
about: For issues that only happen in a specific environment
title: ''
labels: 'compatibility'
assignees: ''

title: ""
labels: "compatibility"
assignees: ""
---

<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
Please provide all info and reduce your schema and data to the smallest possible size.
This template is for compatibility issues.
Expand Down
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/installation.md
@@ -1,14 +1,13 @@
---
name: Installation and dependency issue
about: For issues that happen during installation
title: ''
labels: 'installation'
assignees: ''

title: ""
labels: "installation"
assignees: ""
---

<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
Please provide all info and reduce your schema and data to the smallest possible size.
This template is for installation and dependency issues.
Expand Down
14 changes: 4 additions & 10 deletions .github/ISSUE_TEMPLATE/typescript.md
@@ -1,22 +1,20 @@
---
name: Missing or incorrect type definition
about: Please use for issues related to typescript types
title: ''
labels: 'typescript'
assignees: ''

title: ""
labels: "typescript"
assignees: ""
---

<!--
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/FAQ.md
Frequently Asked Questions: https://github.com/ajv-validator/ajv/blob/master/docs/faq.md
This template is for issues about missing or incorrect type definition and other typescript-related issues.
For other issues please see https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md
-->

**What version of Ajv are you using? Does the issue happen if you use the latest version?**


**Your typescript code**

<!--
Expand All @@ -25,18 +23,14 @@ Please make it as small as posssible to reproduce the issue

```typescript


```


**Typescript compiler error messages**

```
```

**Describe the change that should be made to address the issue?**


**Are you going to resolve the issue?**
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -11,8 +11,6 @@ Please answer the questions below.

**What issue does this pull request resolve?**


**What changes did you make?**


**Is there anything that requires more attention while reviewing?**
10 changes: 6 additions & 4 deletions .gitignore
Expand Up @@ -29,13 +29,15 @@ node_modules

.DS_Store

# Compiled templates
lib/dotjs/*.js

# Browserified tests
.browser

# bundles
# compiled typescript
dist/

# browser bundles
bundle/

package-lock.json

spec/_json/*.js
9 changes: 0 additions & 9 deletions .jshintrc

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierignore
@@ -0,0 +1,7 @@
spec/JSON-Schema-Test-Suite
.browser
coverage
dist
bundle
.nyc_output
spec/_json
28 changes: 14 additions & 14 deletions .tonic_example.js
@@ -1,20 +1,20 @@
var Ajv = require('ajv');
var ajv = new Ajv({allErrors: true});
var Ajv = require("ajv")
var ajv = new Ajv({allErrors: true})

var schema = {
"properties": {
"foo": { "type": "string" },
"bar": { "type": "number", "maximum": 3 }
}
};
properties: {
foo: {type: "string"},
bar: {type: "number", maximum: 3},
},
}

var validate = ajv.compile(schema);
var validate = ajv.compile(schema)

test({"foo": "abc", "bar": 2});
test({"foo": 2, "bar": 4});
test({foo: "abc", bar: 2})
test({foo: 2, bar: 4})

function test(data) {
var valid = validate(data);
if (valid) console.log('Valid!');
else console.log('Invalid: ' + ajv.errorsText(validate.errors));
}
var valid = validate(data)
if (valid) console.log("Valid!")
else console.log("Invalid: " + ajv.errorsText(validate.errors))
}

0 comments on commit 78f67b5

Please sign in to comment.