Skip to content

Commit 18267d4

Browse files
committed
chore: update ESLint configuration and improve test handling
- Updated import paths in ESLint configuration files to use explicit file extensions. - Expanded the list of ignored files in ESLint configuration to include test files. - Modified test scripts in package.json to prevent failures on test run. - Added a LICENSE.md file to the fixtures directory for compliance. - Introduced a test timeout setting in vitest configuration for better performance. Signed-off-by: prisis <d.bannert@anolilab.de>
1 parent fe7d861 commit 18267d4

File tree

29 files changed

+303
-178
lines changed

29 files changed

+303
-178
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-PRESENT Anthony Fu<https://github.com/antfu>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
// This file is generated by ChatGPT
22

33
// eslint-disable-next-line no-console
4-
var log = console.log;
4+
var log = console.log
55

66
// Define a class using ES6 class syntax
77
class Person {
8-
constructor(name, age) {
9-
this.name = name;
10-
this.age = age;
11-
}
12-
13-
// Define a method within the class
14-
sayHello() {
15-
log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
16-
}
8+
constructor(name, age) {
9+
this.name = name;
10+
this.age = age;
11+
}
12+
13+
// Define a method within the class
14+
sayHello() {
15+
log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
16+
}
1717
}
1818

1919
// Create an array of objects
2020
const people = [
21-
new Person("Alice", 30),
22-
new Person("Bob", 25),
23-
new Person("Charlie", 35),
21+
new Person('Alice', 30),
22+
new Person('Bob', 25),
23+
new Person('Charlie', 35)
2424
];
2525

2626
// Use the forEach method to iterate over the array
27-
people.forEach((person) => {
28-
person.sayHello();
27+
people.forEach(person => {
28+
person.sayHello();
2929
});
3030

3131
// Use a template literal to create a multiline string
@@ -35,42 +35,38 @@ const multilineString = `
3535
`;
3636

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

4241
// Use the spread operator to create a new array
4342
const numbers = [1, 2, 3];
4443
const newNumbers = [...numbers, 4, 5];
45-
4644
log(newNumbers);
4745

4846
// Use a try-catch block for error handling
4947
try {
50-
// Attempt to parse an invalid JSON string
51-
JSON.parse("invalid JSON");
48+
// Attempt to parse an invalid JSON string
49+
JSON.parse('invalid JSON');
5250
} catch (error) {
53-
console.error("Error parsing JSON:", error.message);
51+
console.error('Error parsing JSON:', error.message);
5452
}
5553

5654
// Use a ternary conditional operator
57-
const isEven = number_ => number_ % 2 === 0;
55+
const isEven = num => num % 2 === 0;
5856
const number = 7;
59-
60-
log(`${number} is ${isEven(number) ? "even" : "odd"}.`);
57+
log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`);
6158

6259
// Use a callback function with setTimeout for asynchronous code
6360
setTimeout(() => {
64-
log("This code runs after a delay of 2 seconds.");
61+
log('This code runs after a delay of 2 seconds.');
6562
}, 2000);
6663

67-
let a; let b; let c; let d; let
68-
foo;
64+
let a, b, c, d, foo
6965

70-
if (a
71-
|| b
72-
|| c || d
73-
|| (d && b)
74-
) {
75-
foo();
76-
}
66+
if (a
67+
|| b
68+
|| c || d
69+
|| (d && b)
70+
) {
71+
foo()
72+
}
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
export function HelloWorld({
2-
greeted = "\"World\"",
3-
greeting = "hello",
4-
onMouseOver,
5-
silent = false
6-
,
7-
}) {
8-
if (!greeting) {
9-
return null;
10-
}
2+
greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) {
113

12-
// TODO: Don't use random in render
13-
let number_ = Math
14-
.floor(Math.random() * 1E+7)
15-
.toString()
16-
.replaceAll(/\.\d+/g, "");
4+
if(!greeting){
5+
return null};
176

18-
return <div className='HelloWorld' onMouseOver={onMouseOver} title={`You are visitor number ${number_}`}>
19-
<strong>{ greeting.slice(0, 1).toUpperCase() + greeting.slice(1).toLowerCase() }</strong>
20-
{greeting.endsWith(",")
21-
? " "
22-
: <span style={{ color: "\grey" }}>", "</span> }
7+
// TODO: Don't use random in render
8+
let num = Math
9+
.floor (Math.random() * 1E+7).toString()
10+
.replace(/\.\d+/ig, "")
11+
12+
return <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}>
13+
<strong>{ greeting.slice( 0, 1 ).toUpperCase() + greeting.slice(1).toLowerCase() }</strong>
14+
{greeting.endsWith(",")
15+
? " " : <span style={{color: '\grey'}}>", "</span> }
2316
<em>
2417
{ greeted }
2518
</em>
26-
{ silent ? "." : "!"}
19+
{ (silent)? ".": "!"}
2720
</div>;
21+
2822
}

packages/eslint-config/__fixtures__/input/markdown.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ _Look,_ code blocks are formatted *too!*
55

66
```js
77
// This should be handled by ESLint instead of Prettier
8-
/**
9-
*
10-
* @param x
11-
*/
12-
const identity = (x) => {
13-
if (foo) {
14-
console.log("bar");
15-
}
16-
}
8+
function identity(x) {
9+
if (foo) {
10+
console.log('bar');
11+
}
12+
}
1713
```
1814

1915
```css
@@ -32,6 +28,7 @@ Jane Roe|JFK|314
3228
+ with a [link] (/to/somewhere)
3329
+ and [another one]
3430

31+
3532
[another one]: http://example.com 'Example title'
3633

3734
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
comma = [
2-
1,
3-
2,
4-
3,
2+
1
3+
,2
4+
,3,
55
]
66

77
[foo]
8-
b = 1
9-
c = "hello"
10-
a = { answer = 42 }
11-
indent = [
12-
1,
13-
2
8+
b = 1
9+
c = "hello"
10+
a = {answer = 42}
11+
12+
"indent" = [
13+
1,
14+
2
1415
]
1516

16-
[a-table]
17+
['a-table']
1718
apple.type = "fruit"
18-
apple.skin = "thin"
19-
apple.color = "red"
20-
2119
orange.type = "fruit"
20+
apple.skin = "thin"
2221
orange.skin = "thick"
22+
23+
apple.color = "red"
2324
orange.color = "orange"
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"compilerOptions": {
3-
"target": "ESNext",
4-
"module": "ESNext",
5-
"moduleResolution": "Bundler",
6-
"strict": true,
7-
"skipDefaultLibCheck": true,
8-
"skipLibCheck": true
9-
}
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"moduleResolution": "Bundler",
6+
"strict": true,
7+
"skipDefaultLibCheck": true,
8+
"skipLibCheck": true
9+
}
1010
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
export function Component1() {
2-
return <div/>;
2+
return <div/>;
33
}
44

55
export function jsx2() {
6-
const properties = {
7-
a: 1,
8-
b: 2,
9-
};
10-
11-
return < a bar={`foo` } foo= 'bar' >
12-
<div {...properties } a={1} b="2">Inline Text</div>
6+
const props = {a:1,
7+
b:2}
8+
return < a foo= 'bar' bar={`foo` } >
9+
<div {...props }
10+
a={1}
11+
b="2">Inline Text</div>
1312
<Component1>
1413
Block Text
1514
</Component1>
@@ -21,5 +20,5 @@ export function jsx2() {
2120
<p>
2221
foo<i>bar</i><b>baz</b>
2322
</p>
24-
</ a >;
23+
</ a >
2524
}

0 commit comments

Comments
 (0)