Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`linter=eslint fixture=basic_9 version=10.5.0 1`] = `
{
"issues": [
{
"category": "CATEGORY_LINT",
"documentationUrl": "https://eslint.org/docs/rules/no-cond-assign",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.js",
"range": {
"endColumn": 10,
"endLine": 3,
"startColumn": 5,
"startLine": 3,
},
},
"message": "Expected a conditional expression and instead saw an assignment.",
"mode": "MODE_BLOCK",
"ruleKey": "no-cond-assign",
"snippet": "if (x = 2) {",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}",
"tool": "eslint",
},
{
"category": "CATEGORY_LINT",
"documentationUrl": "https://eslint.org/docs/rules/no-constant-condition",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.js",
"range": {
"endColumn": 10,
"endLine": 3,
"startColumn": 5,
"startLine": 3,
},
},
"message": "Unexpected constant condition.",
"mode": "MODE_BLOCK",
"ruleKey": "no-constant-condition",
"snippet": "if (x = 2) {",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}",
"tool": "eslint",
},
{
"category": "CATEGORY_LINT",
"documentationUrl": "https://eslint.org/docs/rules/no-unused-vars",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.js",
"range": {
"endColumn": 6,
"endLine": 3,
"startColumn": 5,
"startLine": 3,
},
},
"message": "'x' is assigned a value but never used.",
"mode": "MODE_BLOCK",
"ruleKey": "no-unused-vars",
"snippet": "if (x = 2) {",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}",
"tool": "eslint",
},
],
}
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import js from "@eslint/js";

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: "latest",
Expand All @@ -10,5 +7,10 @@ export default [
console: "readonly",
},
},
rules: {
"no-cond-assign": "error",
"no-constant-condition": "error",
"no-unused-vars": "error",
},
},
];
2 changes: 1 addition & 1 deletion qlty-plugins/plugins/linters/eslint/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package = "eslint"
file_types = ["javascript", "typescript", "jsx", "tsx"]
affects_cache = [".eslintignore", "package.json", "tsconfig.json"]
latest_version = "10.7.0"
known_good_version = "9.39.4"
known_good_version = "10.5.0"
version_command = "eslint --version"
description = "Javascript and ECMAScript linter"
package_file_candidate = "package.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`linter=oxc fixture=basic version=1.70.0 1`] = `
{
"issues": [
{
"category": "CATEGORY_LINT",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.in.js",
"range": {
"endColumn": 8,
"endLine": 3,
"startColumn": 7,
"startLine": 3,
},
},
"message": "Expected a conditional expression and instead saw an assignment",
"mode": "MODE_BLOCK",
"ruleKey": "eslint(no-cond-assign)",
"snippet": "if (x = 2) {",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}

debugger;",
"tool": "oxc",
},
{
"category": "CATEGORY_LINT",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.in.js",
"range": {
"endColumn": 10,
"endLine": 3,
"startColumn": 5,
"startLine": 3,
},
},
"message": "Unexpected constant condition",
"mode": "MODE_BLOCK",
"ruleKey": "eslint(no-constant-condition)",
"snippet": "if (x = 2) {",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}

debugger;",
"tool": "oxc",
},
{
"category": "CATEGORY_LINT",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.in.js",
"range": {
"endColumn": 10,
"endLine": 7,
"startColumn": 1,
"startLine": 7,
},
},
"message": "\`debugger\` statement is not allowed",
"mode": "MODE_BLOCK",
"ruleKey": "eslint(no-debugger)",
"snippet": "debugger;",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}

debugger;",
"tool": "oxc",
},
{
"category": "CATEGORY_LINT",
"level": "LEVEL_MEDIUM",
"location": {
"path": "basic.in.js",
"range": {
"endColumn": 6,
"endLine": 1,
"startColumn": 5,
"startLine": 1,
},
},
"message": "Variable 'x' is assigned a value but never used. Unused variables should start with a '_'.",
"mode": "MODE_BLOCK",
"ruleKey": "eslint(no-unused-vars)",
"snippet": "let x = 1;",
"snippetWithContext": "let x = 1;

if (x = 2) {
console.log('hi');
}

debugger;",
"tool": "oxc",
},
],
}
`;
6 changes: 1 addition & 5 deletions qlty-plugins/plugins/linters/oxc/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ package = "oxlint"
file_types = ["javascript", "typescript", "jsx", "tsx"]
affects_cache = ["package.json", "tsconfig.json"]
latest_version = "1.74.0"
# oxlint >=1.0 requires node ^20.19 || >=22.12; the managed node runtime (21.7.3)
# fails that engine check, so npm skips the native binding and installs break.
# Bump known_good once the node runtime moves off 21.x. The >=1.0.0 driver block
# below is ready for that (oxlint 1.x changed the --format github title syntax).
known_good_version = "0.11.1"
known_good_version = "1.70.0"
version_command = "oxlint --version"
Comment thread
marschattha marked this conversation as resolved.
Comment thread
marschattha marked this conversation as resolved.
description = "Javascript linter"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`linter=prisma fixture=basic_7 version=7.8.0 1`] = `
{
"issues": [
{
"category": "CATEGORY_STYLE",
"level": "LEVEL_FMT",
"location": {
"path": "basic_7.in.prisma",
},
"message": "Incorrect formatting, autoformat by running \`qlty fmt\`.",
"mode": "MODE_BLOCK",
"onAddedLine": true,
"ruleKey": "fmt",
"tool": "prisma",
},
],
}
`;
31 changes: 31 additions & 0 deletions qlty-plugins/plugins/linters/prisma/fixtures/basic_7.in.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
datasource db {
provider = "postgresql"
}

generator client {
provider = "prisma-client-js"
}

model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
email String @unique
name String?
role Role @default(USER)
posts Post[]
}

model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean @default(false)
title String @db.VarChar(255)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}

enum Role {
USER
ADMIN
}
4 changes: 2 additions & 2 deletions qlty-plugins/plugins/linters/prisma/plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ config_version = "0"
runtime = "node"
package = "prisma"
file_types = ["prisma"]
latest_version = "7.0.0"
known_good_version = "6.15.0"
latest_version = "7.9.0"
known_good_version = "7.8.0"
Comment thread
marschattha marked this conversation as resolved.
version_command = "prisma version"
description = "Prisma schema formatter"

Expand Down
Loading