Skip to content

Commit e1b3205

Browse files
committed
feat: more work on the configs
Signed-off-by: prisis <[email protected]>
1 parent 260ce39 commit e1b3205

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5105
-1346
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
const isJsx = true
3+
const content = "hi!";
4+
---
5+
6+
<article>
7+
<div>{content}</div>
8+
<div>
9+
{isJsx && (
10+
<h1>{content}</h1>
11+
)}
12+
</div>
13+
</article>
14+
15+
16+
<script>
17+
let { log: logger } = console
18+
document.querySelector('h1')?.addEventListener('click', () => {
19+
logger('clicked');
20+
});
21+
</script>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@media (max-width: 480px) {
2+
.bd-examples {margin-right: -.75rem;margin-left: -.75rem
3+
}
4+
5+
.bd-examples>[class^="col-"] {
6+
padding-right: .75rem;
7+
padding-left: .75rem;
8+
9+
}
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<HTML CLASS="no-js mY-ClAsS">
3+
<HEAD>
4+
<META CHARSET="utf-8">
5+
<TITLE>My tITlE</TITLE>
6+
<META NAME="description" content="My CoNtEnT">
7+
</HEAD>
8+
<body>
9+
<P>Hello world!<BR> This is HTML5 Boilerplate.</P>
10+
<SCRIPT>
11+
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
12+
ga('create', 'UA-XXXXX-Y', 'auto'); ga('send', 'pageview')
13+
</SCRIPT>
14+
<SCRIPT
15+
src="https://www.google-analytics.com/analytics.js" ASYNC DEFER></SCRIPT>
16+
</body>
17+
</HTML>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// This file is generated by ChatGPT
2+
3+
// eslint-disable-next-line no-console
4+
var log = console.log;
5+
6+
// Define a class using ES6 class syntax
7+
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+
}
17+
}
18+
19+
// Create an array of objects
20+
const people = [
21+
new Person("Alice", 30),
22+
new Person("Bob", 25),
23+
new Person("Charlie", 35),
24+
];
25+
26+
// Use the forEach method to iterate over the array
27+
people.forEach((person) => {
28+
person.sayHello();
29+
});
30+
31+
// Use a template literal to create a multiline string
32+
const multilineString = `
33+
This is a multiline string
34+
that spans multiple lines.
35+
`;
36+
37+
// Use destructuring assignment to extract values from an object
38+
const { age, name } = people[0];
39+
40+
log(`First person in the array is ${name} and they are ${age} years old.`, multilineString);
41+
42+
// Use the spread operator to create a new array
43+
const numbers = [1, 2, 3];
44+
const newNumbers = [...numbers, 4, 5];
45+
46+
log(newNumbers);
47+
48+
// Use a try-catch block for error handling
49+
try {
50+
// Attempt to parse an invalid JSON string
51+
JSON.parse("invalid JSON");
52+
} catch (error) {
53+
console.error("Error parsing JSON:", error.message);
54+
}
55+
56+
// Use a ternary conditional operator
57+
const isEven = number_ => number_ % 2 === 0;
58+
const number = 7;
59+
60+
log(`${number} is ${isEven(number) ? "even" : "odd"}.`);
61+
62+
// Use a callback function with setTimeout for asynchronous code
63+
setTimeout(() => {
64+
log("This code runs after a delay of 2 seconds.");
65+
}, 2000);
66+
67+
let a; let b; let c; let d; let
68+
foo;
69+
70+
if (a
71+
|| b
72+
|| c || d
73+
|| (d && b)
74+
) {
75+
foo();
76+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export function HelloWorld({
2+
greeted = "\"World\"",
3+
greeting = "hello",
4+
onMouseOver,
5+
silent = false
6+
,
7+
}) {
8+
if (!greeting) {
9+
return null;
10+
}
11+
12+
// TODO: Don't use random in render
13+
let number_ = Math
14+
.floor(Math.random() * 1E+7)
15+
.toString()
16+
.replaceAll(/\.\d+/g, "");
17+
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> }
23+
<em>
24+
{ greeted }
25+
</em>
26+
{ silent ? "." : "!"}
27+
</div>;
28+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Header
2+
======
3+
4+
_Look,_ code blocks are formatted *too!*
5+
6+
```js
7+
// This should be handled by ESLint instead of Prettier
8+
/**
9+
*
10+
* @param x
11+
*/
12+
function identity(x) {
13+
if (foo) {
14+
console.log("bar");
15+
}
16+
}
17+
```
18+
19+
```css
20+
/* This should be handled by Prettier */
21+
.foo { color:red;}
22+
```
23+
24+
Pilot|Airport|Hours
25+
--|:--:|--:
26+
John Doe|SKG|1338
27+
Jane Roe|JFK|314
28+
29+
- - - - - - - - - - - - - - -
30+
31+
+ List
32+
+ with a [link] (/to/somewhere)
33+
+ and [another one]
34+
35+
[another one]: http://example.com 'Example title'
36+
37+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
38+
Curabitur consectetur maximus risus, sed maximus tellus tincidunt et.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script lang='ts'>
2+
export const content = "hi!"
3+
</script>
4+
5+
<article>
6+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
7+
<div>{@html content}</div>
8+
</article>
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
comma = [
2+
1,
3+
2,
4+
3,
5+
]
6+
7+
[foo]
8+
b = 1
9+
c = "hello"
10+
a = { answer = 42 }
11+
indent = [
12+
1,
13+
2
14+
]
15+
16+
[a-table]
17+
apple.type = "fruit"
18+
apple.skin = "thin"
19+
apple.color = "red"
20+
21+
orange.type = "fruit"
22+
orange.skin = "thick"
23+
orange.color = "orange"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"moduleResolution": "Bundler",
6+
"strict": true,
7+
"skipDefaultLibCheck": true,
8+
"skipLibCheck": true
9+
}
10+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export function Component1() {
2+
return <div/>;
3+
}
4+
5+
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>
13+
<Component1>
14+
Block Text
15+
</Component1>
16+
<div>
17+
Mixed
18+
<div>Foo</div>
19+
Text<b > Bar</b>
20+
</div>
21+
<p>
22+
foo<i>bar</i><b>baz</b>
23+
</p>
24+
</ a >;
25+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Define a TypeScript interface
2+
interface Person {
3+
age: number;
4+
name: string;
5+
}
6+
7+
// Create an array of objects with the defined interface
8+
const people: Person[] = [
9+
{ age: 30, name: "Alice" },
10+
{ age: 25, name: "Bob" },
11+
{
12+
age: 35,
13+
name: "Charlie",
14+
},
15+
];
16+
17+
// eslint-disable-next-line no-console
18+
const log = console.log;
19+
20+
// Use a for...of loop to iterate over the array
21+
for (const person of people) {
22+
log(`Hello, my name is ${person.name} and I am ${person.age} years old.`);
23+
}
24+
25+
// Define a generic function
26+
function identity< T >(argument: T): T {
27+
return argument;
28+
}
29+
30+
// Use the generic function with type inference
31+
const result = identity(
32+
"TypeScript is awesome",
33+
);
34+
35+
log(result);
36+
37+
// Use optional properties in an interface
38+
interface Car {
39+
make: string;
40+
model?: string;
41+
}
42+
43+
// Create objects using the interface
44+
const car1: Car = { make: "Toyota" };
45+
const car2: Car = {
46+
make: "Ford",
47+
model: "Focus",
48+
49+
};
50+
51+
// Use union types
52+
type Fruit = "apple" | "banana" | "orange";
53+
const favoriteFruit: Fruit = "apple";
54+
55+
// Use a type assertion to tell TypeScript about the type
56+
const inputValue: any = "42";
57+
const numericValue = inputValue as number;
58+
59+
// Define a class with access modifiers
60+
class Animal {
61+
private name: string;
62+
63+
constructor(name: string) {
64+
this.name = name;
65+
}
66+
67+
protected makeSound(sound: string) {
68+
log(`${this.name} says ${sound}`);
69+
}
70+
}
71+
72+
// Extend a class
73+
class Dog extends Animal {
74+
constructor(private alias: string) {
75+
super(alias);
76+
}
77+
78+
bark() {
79+
this.makeSound("Woof!");
80+
}
81+
}
82+
83+
const dog = new Dog("Buddy");
84+
85+
dog.bark();
86+
87+
const function_ = (): string => {
88+
return "hello" + 1;
89+
};
90+
91+
log(car1, car2, favoriteFruit, numericValue, function_());

0 commit comments

Comments
 (0)