Skip to content

Commit db96e6d

Browse files
committed
Using @Stylistic eslint plugin
1 parent eaced2e commit db96e6d

File tree

6 files changed

+44
-45
lines changed

6 files changed

+44
-45
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
use_exact=true
1+
save-exact=true

bun.lockb

6.22 KB
Binary file not shown.

eslintrc/core.cjs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const path = require("path");
1+
// const path = require("path");
2+
// const stylistic = require("@stylistic/eslint-plugin");
33

44
/**
55
* Requires:
66
* - eslint
7-
* - @typescript-eslint/eslint-plugin
87
* - @typescript-eslint/parser
8+
* - @stylistic/eslint-plugin
99
*/
1010
/** @type {import("eslint").Linter.Config} */
1111
const config = {
1212
parser: "@typescript-eslint/parser",
1313
parserOptions: {
14-
project: path.join(__dirname, "tsconfig.json"),
14+
// project: path.join(process.cwd, "tsconfig.json"),
1515
},
16-
plugins: ["@typescript-eslint"],
16+
plugins: [
17+
"@stylistic",
18+
"@typescript-eslint"
19+
],
1720
extends: [
18-
"plugin:@typescript-eslint/recommended",
19-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
20-
"plugin:@typescript-eslint/recommended-type-checked",
21-
"plugin:@typescript-eslint/stylistic-type-checked"
21+
"plugin:@stylistic/recommended-extends"
2222
],
2323
rules: {
2424
// Helps with tree shaking, I think
@@ -35,26 +35,28 @@ const config = {
3535
"error",
3636
{ "ts-ignore": "allow-with-description" },
3737
],
38+
"@typescript-eslint/no-explicit-any": "warn",
3839

3940
// Warn if any vars are unused, but ignore it if the var is just "_".
4041
"no-unused-vars": "off",
4142
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_$" }],
4243

4344
// Have semi-colons
4445
"semi": ["off"],
45-
"@typescript-eslint/semi": ["warn"],
46+
"@stylistic/semi": ["warn"],
4647

4748
// Double quotes
48-
"quotes": ["warn", "double"],
49-
"@typescript-eslint/no-explicit-any": "warn",
49+
"quotes": "off",
50+
"@stylistic/quotes": ["error", "double"],
5051

5152
// Alman brace styling
5253
"brace-style": "off",
53-
"@typescript-eslint/brace-style": ["error", "allman"],
54+
"@stylistic/brace-style": ["error", "allman"],
5455

5556
// Index with tabs instead of spaces
5657
"indent": "off",
57-
"@typescript-eslint/indent": ["error", "tab"],
58+
"@stylistic/no-tabs": "off",
59+
"@stylistic/indent": ["error", "tab"],
5860

5961
// I like to be able to use if occassionally for lazy debugging
6062
"no-console": "warn",

eslintrc/next.cjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
/**
22
* Requires:
33
* - eslint
4-
* - @typescript-eslint/eslint-plugin
54
* - @typescript-eslint/parser
6-
* - eslint-plugin-react
7-
* - eslint-plugin-react-hooks
5+
* - @stylistic/eslint-plugin
86
* - eslint-config-next
97
*/
108
/** @type {import("eslint").Linter.Config} */
119
const config = {
1210
extends: [
13-
"./react.js",
11+
"./react.cjs",
1412
"next/core-web-vitals",
1513
],
1614
rules: {

eslintrc/react.cjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1+
12
/**
23
* Requires:
34
* - eslint
4-
* - @typescript-eslint/eslint-plugin
55
* - @typescript-eslint/parser
6-
* - eslint-plugin-react
7-
* - eslint-plugin-react-hooks
6+
* - @stylistic/eslint-plugin
87
*/
98
/** @type {import("eslint").Linter.Config} */
109
const config = {
10+
plugins: [],
1111
extends: [
12-
"./core.js",
13-
"plugin:react/recommended",
12+
"./core.cjs",
1413
],
1514
rules: {
16-
"react/function-component-definition": ["warn", { namedComponents: "arrow-function", unnamedComponents: "arrow-function" }],
17-
"react/jsx-indent": [
18-
"error",
19-
"tab",
20-
{
21-
checkAttributes: true,
22-
indentLogicalExpressions: true
23-
}
24-
],
15+
// "@stylistic/function-component-definition": ["warn", { namedComponents: "arrow-function", unnamedComponents: "arrow-function" }],
16+
// "@stylistic/jsx-indent": [
17+
// "error",
18+
// "tab",
19+
// {
20+
// checkAttributes: true,
21+
// indentLogicalExpressions: true
22+
// }
23+
// ],
24+
"@stylistic/jsx-indent-props": ["error", "tab"]
2525
},
2626
};
2727

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
{
22
"name": "@dief/prefs",
33
"version": "1.0.0",
4-
"description": "My personal, opinionated prefs",
5-
"files": [
6-
"eslintrc/*"
7-
],
8-
"repository": "https://github.com/DiefBell/prefs.git",
94
"author": "diefbell <[email protected]>",
10-
"license": "Unlicense",
5+
"repository": "https://github.com/DiefBell/prefs.git",
116
"dependencies": {
7+
"@stylistic/eslint-plugin": "2.7.1",
128
"@types/eslint": "8.56.0",
13-
"@typescript-eslint/eslint-plugin": "^8.3.0",
14-
"@typescript-eslint/parser": "^8.3.0",
9+
"@typescript-eslint/eslint-plugin": "8.3.0",
10+
"@typescript-eslint/parser": "8.3.0",
1511
"eslint": "8.56.0",
16-
"eslint-config-next": "^14.2.7",
17-
"eslint-plugin-react": "^7.35.0",
18-
"eslint-plugin-react-hooks": "4.6.2"
19-
}
12+
"eslint-config-next": "14.2.7"
13+
},
14+
"description": "My personal, opinionated prefs",
15+
"files": [
16+
"eslintrc/*"
17+
],
18+
"license": "Unlicense"
2019
}

0 commit comments

Comments
 (0)