@absc_company/eslint 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +17 -0
  2. package/dist/index.mjs +77 -0
  3. package/package.json +57 -0
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # :milky_way: ABSC-company eslint
2
+
3
+ ## Установить конфиг
4
+
5
+ ```sh
6
+ pnpm add -D @absc_company/eslint
7
+ ```
8
+
9
+ ## Как использовать
10
+
11
+ Создать файл `eslint.config.js` и добавить в него содержимое:
12
+
13
+ ```js
14
+ import config from '@absc_company/eslint';
15
+
16
+ export default config;
17
+ ```
package/dist/index.mjs ADDED
@@ -0,0 +1,77 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import perfectionist from "eslint-plugin-perfectionist";
4
+ import react from "eslint-plugin-react";
5
+ import reactHooks from "eslint-plugin-react-hooks";
6
+ import reactRefresh from "eslint-plugin-react-refresh";
7
+ import { defineConfig, globalIgnores } from "eslint/config";
8
+ import globals from "globals";
9
+ import tseslint from "typescript-eslint";
10
+ //#region src/index.ts
11
+ const eslintConfig = (params = {}) => defineConfig([globalIgnores(["dist", "node_modules"]), {
12
+ files: ["**/*.{ts,tsx}"],
13
+ settings: { react: { version: "detect" } },
14
+ extends: [
15
+ js.configs.recommended,
16
+ tseslint.configs.recommended,
17
+ reactHooks.configs.flat.recommended,
18
+ reactRefresh.configs.vite
19
+ ],
20
+ plugins: {
21
+ react,
22
+ perfectionist
23
+ },
24
+ languageOptions: { globals: {
25
+ ...globals.browser,
26
+ ...globals.node
27
+ } },
28
+ rules: {
29
+ ...eslintConfigPrettier.rules,
30
+ "sort-imports": "off",
31
+ "perfectionist/sort-imports": ["error", {
32
+ type: "natural",
33
+ customGroups: [
34
+ {
35
+ groupName: "react",
36
+ elementNamePattern: ["^react$", "^react-dom$"]
37
+ },
38
+ {
39
+ groupName: "css-modules",
40
+ elementNamePattern: ["\\.module\\.css$", "\\.module\\.scss$"]
41
+ },
42
+ {
43
+ groupName: "css-files",
44
+ elementNamePattern: ["\\.css$", "\\.scss$"]
45
+ }
46
+ ],
47
+ groups: [
48
+ "value-builtin",
49
+ "react",
50
+ "value-external",
51
+ [
52
+ "value-internal",
53
+ "value-parent",
54
+ "value-sibling",
55
+ "value-index"
56
+ ],
57
+ "type-import",
58
+ "css-modules",
59
+ "css-files",
60
+ "side-effect"
61
+ ],
62
+ newlinesBetween: 0,
63
+ ...params.perfectionistSortImports ?? {}
64
+ }],
65
+ "react/jsx-curly-brace-presence": ["error", {
66
+ props: "never",
67
+ children: "never"
68
+ }],
69
+ "react/function-component-definition": ["error", {
70
+ namedComponents: "arrow-function",
71
+ unnamedComponents: "arrow-function"
72
+ }],
73
+ "arrow-body-style": ["error", "as-needed"]
74
+ }
75
+ }]);
76
+ //#endregion
77
+ export { eslintConfig };
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@absc_company/eslint",
3
+ "type": "module",
4
+ "version": "1.0.0",
5
+ "license": "MIT",
6
+ "description": "@absc_company/eslint",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": "./dist/index.mjs",
11
+ "scripts": {
12
+ "prepublishOnly": "pnpm type && pnpm build",
13
+ "build": "tsdown",
14
+ "type": "tsc --noEmit -p tsconfig.json",
15
+ "format": "prettier --write \"../../**/*.{js,ts,tsx,json,md}\"",
16
+ "lint": "eslint .",
17
+ "lint:fix": "eslint . --fix",
18
+ "steiger": "steiger ./src",
19
+ "steiger:fix": "steiger ./src --fix",
20
+ "stylelint": "stylelint \"**/*.{css,scss}\"",
21
+ "stylelint:fix": "stylelint \"**/*.{css,scss}\" --fix"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/ABSC-company/synapse-config-package.git"
29
+ },
30
+ "devDependencies": {
31
+ "@absc_company/prettier": "workspace:*",
32
+ "@absc_company/semantic-release": "workspace:*",
33
+ "@absc_company/steiger": "workspace:*",
34
+ "@absc_company/stylelint": "workspace:*",
35
+ "@absc_company/tsconfig": "workspace:*",
36
+ "@eslint/js": "^10.0.1",
37
+ "@semantic-release/commit-analyzer": "^13.0.1",
38
+ "@semantic-release/git": "^10.0.1",
39
+ "@semantic-release/github": "^12.0.6",
40
+ "@semantic-release/npm": "^13.1.5",
41
+ "@semantic-release/release-notes-generator": "^14.1.0",
42
+ "conventional-changelog-conventionalcommits": "^8.0.0",
43
+ "eslint": "^9.39.4",
44
+ "eslint-config-prettier": "^10.1.8",
45
+ "eslint-plugin-perfectionist": "^5.9.0",
46
+ "eslint-plugin-react": "^7.37.5",
47
+ "eslint-plugin-react-hooks": "^7.1.1",
48
+ "eslint-plugin-react-refresh": "^0.5.2",
49
+ "globals": "^17.6.0",
50
+ "semantic-release": "^24.2.9",
51
+ "typescript-eslint": "^8.59.2",
52
+ "steiger": "^0.5.13",
53
+ "@feature-sliced/steiger-plugin": "^0.6.0",
54
+ "stylelint": "^17.13.0",
55
+ "stylelint-config-standard": "^40.0.0"
56
+ }
57
+ }