Skip to content

Commit

Permalink
🐛 fix(config): _actually_ fix testing this time lol
Browse files Browse the repository at this point in the history
  • Loading branch information
pauliesnug committed Jun 1, 2024
1 parent 7d15db3 commit 69a17ff
Show file tree
Hide file tree
Showing 35 changed files with 665 additions and 588 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@flowr/tsconfig": "workspace:^",
"@stylistic/eslint-plugin": "^2.1.0",
"@stylistic/eslint-plugin-migrate": "^2.1.0",
"@types/node": "^20.12.13",
"@types/node": "^20.13.0",
"bumpp": "^9.4.1",
"esbuild": "^0.21.4",
"eslint": "npm:eslint-ts-patch@9.2.0-6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/fixtures/output/all/astro.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
const isJsx = true
const isJsx = true;
const content = 'hi!';
---

Expand Down
68 changes: 34 additions & 34 deletions packages/eslint-config/fixtures/output/all/javascript.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
// eslint-disable-next-line no-console
const log = console.log
const log = console.log;

// Define a class using ES6 class syntax
class Person {
constructor(name, age) {
this.name = name
this.age = age
}
constructor(name, age) {
this.name = name;
this.age = age;
}

// Define a method within the class
sayHello() {
log(`Hello, my name is ${this.name} and I am ${this.age} years old.`)
}
// Define a method within the class
sayHello() {
log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
}
}

// Create an array of objects
const people = [
new Person('Alice', 30),
new Person('Bob', 25),
new Person('Charlie', 35),
]
new Person('Alice', 30),
new Person('Bob', 25),
new Person('Charlie', 35),
];

// Use the forEach method to iterate over the array
people.forEach((person) => {
person.sayHello()
})
person.sayHello();
});

// Use a template literal to create a multiline string
const multilineString = `
This is a multiline string
that spans multiple lines.
`
`;

// Use destructuring assignment to extract values from an object
const { name, age } = people[0]
log(`First person in the array is ${name} and they are ${age} years old.`, multilineString)
const { name, age } = people[0];
log(`First person in the array is ${name} and they are ${age} years old.`, multilineString);

// Use the spread operator to create a new array
const numbers = [1, 2, 3]
const newNumbers = [...numbers, 4, 5]
log(newNumbers)
const numbers = [1, 2, 3];
const newNumbers = [...numbers, 4, 5];
log(newNumbers);

// Use a try-catch block for error handling
try {
// Attempt to parse an invalid JSON string
JSON.parse('invalid JSON')
// Attempt to parse an invalid JSON string
JSON.parse('invalid JSON');
}
catch (error) {
console.error('Error parsing JSON:', error.message)
console.error('Error parsing JSON:', error.message);
}

// Use a ternary conditional operator
const isEven = num => num % 2 === 0
const number = 7
log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`)
const isEven = num => num % 2 === 0;
const number = 7;
log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`);

// Use a callback function with setTimeout for asynchronous code
setTimeout(() => {
log('This code runs after a delay of 2 seconds.')
}, 2000)
log('This code runs after a delay of 2 seconds.');
}, 2000);

let a, b, c, d, foo
let a, b, c, d, foo;

if (a
|| b
|| c || d
|| (d && b)
|| b
|| c || d
|| (d && b)
)
foo()
foo();
41 changes: 20 additions & 21 deletions packages/eslint-config/fixtures/output/all/jsx.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
export function HelloWorld({
greeting = 'hello',
greeted = '"World"',
silent = false,
onMouseOver,
greeting = 'hello',
greeted = '"World"',
silent = false,
onMouseOver,
}) {
if (!greeting)
return null
if (!greeting)
return null;
;

// TODO: Don't use random in render
const num = Math.floor (Math.random() * 1e+7).toString()
.replace(/\.\d+/g, '')
// TODO: Don't use random in render
const num = Math.floor (Math.random() * 1e+7).toString()
.replace(/\.\d+/g, '');

return (
<div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver}>
<strong>{ greeting.slice(0, 1).toUpperCase() + greeting.slice(1).toLowerCase() }</strong>
{greeting.endsWith(',')
? ' '
: <span style={{ color: '\grey' }}>", "</span> }
<em>
{ greeted }
</em>
{ (silent) ? '.' : '!'}
</div>
)
return (
<div className="HelloWorld" title={`You are visitor number ${num}`} onMouseOver={onMouseOver}>
<strong>{ greeting.slice(0, 1).toUpperCase() + greeting.slice(1).toLowerCase() }</strong>
{greeting.endsWith(',') ? ' ' : <span style={{ color: '\grey' }}>", "</span> }
<em>
{ greeted }
</em>
{ (silent) ? '.' : '!'}
</div>
);
}
4 changes: 2 additions & 2 deletions packages/eslint-config/fixtures/output/all/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ _Look,_ code blocks are formatted *too!*
```js
// This should be handled by ESLint instead of Prettier
function identity(x) {
if (foo)
console.log('bar')
if (foo)
console.log('bar');
}
```

Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config/fixtures/output/all/svelte.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang='ts'>
export const content = 'hi!'
export const content = 'hi!';
</script>

<article>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<div>{@html content}</div>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<div>{@html content}</div>
</article>
54 changes: 27 additions & 27 deletions packages/eslint-config/fixtures/output/all/tsx.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
export function Component1() {
return <div />
return <div />;
}

export function jsx2() {
const props = { a: 1, b: 2 }
return (
<a foo="bar" bar="foo">
<div
{...props}
a={1}
b="2"
>
Inline Text
</div>
<Component1>
Block Text
</Component1>
<div>
Mixed
<div>Foo</div>
Text
<b> Bar</b>
</div>
<p>
foo
<i>bar</i>
<b>baz</b>
</p>
</a>
)
const props = { a: 1, b: 2 };
return (
<a foo="bar" bar="foo">
<div
{...props}
a={1}
b="2"
>
Inline Text
</div>
<Component1>
Block Text
</Component1>
<div>
Mixed
<div>Foo</div>
Text
<b> Bar</b>
</div>
<p>
foo
<i>bar</i>
<b>baz</b>
</p>
</a>
);
}
80 changes: 40 additions & 40 deletions packages/eslint-config/fixtures/output/all/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
// Define a TypeScript interface
interface Person {
name: string
age: number
name: string;
age: number;
}

// Create an array of objects with the defined interface
const people: Person[] = [
{ name: 'Alice', age: 30 },
{ name: 'Bob', age: 25 },
{ name: 'Charlie', age: 35 },
]
{ name: 'Alice', age: 30 },
{ name: 'Bob', age: 25 },
{ name: 'Charlie', age: 35 },
];

// eslint-disable-next-line no-console
const log = console.log
const log = console.log;

// Use a for...of loop to iterate over the array
for (const person of people)
log(`Hello, my name is ${person.name} and I am ${person.age} years old.`)
log(`Hello, my name is ${person.name} and I am ${person.age} years old.`);

// Define a generic function
function identity< T >(arg: T): T {
return arg
return arg;
}

// Use the generic function with type inference
const result = identity(
'TypeScript is awesome',
)
log(result)
'TypeScript is awesome',
);
log(result);

// Use optional properties in an interface
interface Car {
make: string
model?: string
make: string;
model?: string;
}

// Create objects using the interface
const car1: Car = { make: 'Toyota' }
const car1: Car = { make: 'Toyota' };
const car2: Car = {
make: 'Ford',
model: 'Focus',
}
make: 'Ford',
model: 'Focus',
};

// Use union types
type Fruit = 'apple' | 'banana' | 'orange'
const favoriteFruit: Fruit = 'apple'
type Fruit = 'apple' | 'banana' | 'orange';
const favoriteFruit: Fruit = 'apple';

// Use a type assertion to tell TypeScript about the type
const inputValue: any = '42'
const numericValue = inputValue as number
const inputValue: any = '42';
const numericValue = inputValue as number;

// Define a class with access modifiers
class Animal {
private name: string
constructor(name: string) {
this.name = name
}

protected makeSound(sound: string) {
log(`${this.name} says ${sound}`)
}
private name: string;
constructor(name: string) {
this.name = name;
}

protected makeSound(sound: string) {
log(`${this.name} says ${sound}`);
}
}

// Extend a class
class Dog extends Animal {
constructor(private alias: string) {
super(alias)
}
constructor(private alias: string) {
super(alias);
}

bark() {
this.makeSound('Woof!')
}
bark() {
this.makeSound('Woof!');
}
}

const dog = new Dog('Buddy')
dog.bark()
const dog = new Dog('Buddy');
dog.bark();

function fn(): string {
return `hello${1}`
return `hello${1}`;
}

log(car1, car2, favoriteFruit, numericValue, fn())
log(car1, car2, favoriteFruit, numericValue, fn());
Loading

0 comments on commit 69a17ff

Please sign in to comment.