@evaneos/front-config 1.0.5 → 1.2.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.
package/README.md CHANGED
@@ -15,22 +15,83 @@ npm install @evaneos/front-config@latest
15
15
  In your `eslint.config.(c|m)js` file, add:
16
16
 
17
17
  ```cjs
18
- const evaneosConfig = require("@evaneos/front-config/eslint/eslint.config.js");
18
+ const evaneosConfig = require('@evaneos/front-config/eslint/index.js');
19
19
  module.export = [...evaneosConfig];
20
20
  ```
21
21
 
22
22
  ```mjs
23
- import evaneosConfig from "@evaneos/front-config/eslint/eslint.config.mjs";
23
+ import evaneosConfig from '@evaneos/front-config/eslint/index.mjs';
24
24
  export default [...evaneosConfig];
25
25
  ```
26
26
 
27
+ You may want to turn off the new rules, here is an example from rm
28
+
29
+ ```
30
+ import globals from 'globals';
31
+ import evaneosConfig from '@evaneos/front-config/eslint/index.mjs';
32
+
33
+ export default [
34
+ ...evaneosConfig,
35
+ {
36
+ files: ['**/*.ts', '**/*.tsx'],
37
+ rules: {
38
+ '@typescript-eslint/ban-ts-comment': 'off',
39
+ '@typescript-eslint/no-unsafe-assignment': 'off',
40
+ '@typescript-eslint/no-unsafe-member-access': 'off',
41
+ '@typescript-eslint/no-unsafe-argument': 'off',
42
+ '@typescript-eslint/no-unsafe-return': 'off',
43
+ '@typescript-eslint/no-unsafe-call': 'off',
44
+ '@typescript-eslint/no-duplicate-type-constituents': 'off',
45
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
46
+ '@typescript-eslint/no-unused-expressions': 'off',
47
+ '@typescript-eslint/unbound-method': 'off',
48
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
49
+ '@typescript-eslint/only-throw-error': 'off',
50
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
51
+ '@typescript-eslint/await-thenable': 'off',
52
+ '@typescript-eslint/require-await': 'off',
53
+ 'no-constant-binary-expression': 'off',
54
+ '@typescript-eslint/no-empty-function': 'off',
55
+ 'jsx-a11y/alt-text': 'off',
56
+ },
57
+ },
58
+ ];
59
+
60
+ ```
61
+
62
+ You may want to lint some files differently, for example if its node or browser or test files, if so you can do like this:
63
+
64
+ ```
65
+
66
+ {
67
+ files: [
68
+ 'webpack.config.dev.js',
69
+ 'webpack.config.prod.js',
70
+ 'webpack.config.common.js',
71
+ '.jestrc.js',
72
+ '.prettierrc.js',
73
+ 'babel.config.js',
74
+ 'jest/mediaFileTransformer.js',
75
+ 'jest/setup.js',
76
+ ],
77
+ rules: {
78
+ '@typescript-eslint/no-require-imports': 'off',
79
+ },
80
+ languageOptions: {
81
+ globals: {
82
+ ...globals.node,
83
+ },
84
+ },
85
+ },
86
+ ```
87
+
27
88
  ## TSConfig
28
89
 
29
90
  In your `tsconfig.json` file, add:
30
91
 
31
92
  ```json
32
93
  {
33
- "extends": "@evaneos/front-config/config/tsconfig.json"
94
+ "extends": "@evaneos/front-config/config/tsconfig.json"
34
95
  }
35
96
  ```
36
97
 
@@ -40,7 +101,7 @@ In your `.prettierrc.js` file add:
40
101
 
41
102
  ```js
42
103
  module.exports = {
43
- ...require("@evaneos/front-config/linting/prettier-config.js"),
104
+ ...require('@evaneos/front-config/prettier/index.js'),
44
105
  };
45
106
  ```
46
107
 
package/eslint/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
8
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
9
  var __getProtoOf = Object.getPrototypeOf;
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
19
21
  }
20
22
  return a;
21
23
  };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
25
  var __commonJS = (cb, mod) => function __require() {
23
26
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
27
  };
@@ -3074,13 +3077,6 @@ var _a, _b;
3074
3077
  var react_default = [
3075
3078
  (_a = import_eslint_plugin_react.default.configs.flat) == null ? void 0 : _a.recommended,
3076
3079
  (_b = import_eslint_plugin_react.default.configs.flat) == null ? void 0 : _b["jsx-runtime"],
3077
- {
3078
- rules: {
3079
- "react/display-name": 0,
3080
- "react/prop-types": 0,
3081
- "react/react-in-jsx-scope": 0
3082
- }
3083
- },
3084
3080
  {
3085
3081
  files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
3086
3082
  plugins: {
@@ -3093,32 +3089,15 @@ var react_default = [
3093
3089
  }
3094
3090
  },
3095
3091
  globals: __spreadValues({}, import_globals.default.browser)
3096
- },
3097
- rules: {
3098
- // ... any rules you want
3099
- "react/jsx-uses-react": "error",
3100
- "react/jsx-uses-vars": "error"
3101
3092
  }
3102
- // ... others are omitted for brevity
3103
3093
  },
3104
- {
3105
- files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
3106
- plugins: {
3107
- "jsx-a11y": import_eslint_plugin_jsx_a11y.default
3108
- },
3109
- languageOptions: {
3110
- parserOptions: {
3111
- ecmaFeatures: {
3112
- jsx: true
3113
- }
3114
- }
3115
- },
3116
- rules: {
3117
- // ... any rules you want
3118
- "jsx-a11y/alt-text": "error"
3119
- }
3120
- // ... others are omitted for brevity
3121
- }
3094
+ __spreadProps(__spreadValues({
3095
+ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"]
3096
+ }, import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended), {
3097
+ languageOptions: __spreadProps(__spreadValues({}, import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended.languageOptions), {
3098
+ globals: __spreadValues(__spreadValues({}, import_globals.default.serviceworker), import_globals.default.browser)
3099
+ })
3100
+ })
3122
3101
  ];
3123
3102
 
3124
3103
  // src/eslint/rules/test.ts
@@ -3139,14 +3118,6 @@ var test_default = [
3139
3118
  plugins: { jest: import_eslint_plugin_jest.default },
3140
3119
  languageOptions: {
3141
3120
  globals: import_eslint_plugin_jest.default.environments.globals.globals
3142
- },
3143
- rules: {
3144
- "jest/no-disabled-tests": "off",
3145
- "jest/no-focused-tests": "off",
3146
- "jest/no-identical-title": "error",
3147
- "jest/prefer-to-have-length": "warn",
3148
- "@typescript-eslint/no-require-imports": "off",
3149
- "jest/valid-expect": "off"
3150
3121
  }
3151
3122
  }
3152
3123
  ];
@@ -3159,7 +3130,14 @@ var override_default = [
3159
3130
  "prefer-const": 1,
3160
3131
  "prefer-destructuring": 1,
3161
3132
  "prefer-spread": 1,
3162
- "arrow-body-style": 0
3133
+ "arrow-body-style": 0,
3134
+ "react/display-name": 0,
3135
+ "react/prop-types": 0,
3136
+ "react/react-in-jsx-scope": 0,
3137
+ "react/jsx-uses-react": "error",
3138
+ "react/jsx-uses-vars": "error",
3139
+ "@typescript-eslint/no-unsafe-member-access": "off",
3140
+ "@typescript-eslint/no-unsafe-assignment": "off"
3163
3141
  }
3164
3142
  }
3165
3143
  ];
package/eslint/index.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
8
  var __getProtoOf = Object.getPrototypeOf;
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
18
20
  }
19
21
  return a;
20
22
  };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
24
  var __commonJS = (cb, mod) => function __require() {
22
25
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
23
26
  };
@@ -3063,13 +3066,6 @@ var _a, _b;
3063
3066
  var react_default = [
3064
3067
  (_a = reactPlugin.configs.flat) == null ? void 0 : _a.recommended,
3065
3068
  (_b = reactPlugin.configs.flat) == null ? void 0 : _b["jsx-runtime"],
3066
- {
3067
- rules: {
3068
- "react/display-name": 0,
3069
- "react/prop-types": 0,
3070
- "react/react-in-jsx-scope": 0
3071
- }
3072
- },
3073
3069
  {
3074
3070
  files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
3075
3071
  plugins: {
@@ -3082,32 +3078,15 @@ var react_default = [
3082
3078
  }
3083
3079
  },
3084
3080
  globals: __spreadValues({}, import_globals.default.browser)
3085
- },
3086
- rules: {
3087
- // ... any rules you want
3088
- "react/jsx-uses-react": "error",
3089
- "react/jsx-uses-vars": "error"
3090
3081
  }
3091
- // ... others are omitted for brevity
3092
3082
  },
3093
- {
3094
- files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
3095
- plugins: {
3096
- "jsx-a11y": jsxA11y
3097
- },
3098
- languageOptions: {
3099
- parserOptions: {
3100
- ecmaFeatures: {
3101
- jsx: true
3102
- }
3103
- }
3104
- },
3105
- rules: {
3106
- // ... any rules you want
3107
- "jsx-a11y/alt-text": "error"
3108
- }
3109
- // ... others are omitted for brevity
3110
- }
3083
+ __spreadProps(__spreadValues({
3084
+ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"]
3085
+ }, jsxA11y.flatConfigs.recommended), {
3086
+ languageOptions: __spreadProps(__spreadValues({}, jsxA11y.flatConfigs.recommended.languageOptions), {
3087
+ globals: __spreadValues(__spreadValues({}, import_globals.default.serviceworker), import_globals.default.browser)
3088
+ })
3089
+ })
3111
3090
  ];
3112
3091
 
3113
3092
  // src/eslint/rules/test.ts
@@ -3128,14 +3107,6 @@ var test_default = [
3128
3107
  plugins: { jest: pluginJest },
3129
3108
  languageOptions: {
3130
3109
  globals: pluginJest.environments.globals.globals
3131
- },
3132
- rules: {
3133
- "jest/no-disabled-tests": "off",
3134
- "jest/no-focused-tests": "off",
3135
- "jest/no-identical-title": "error",
3136
- "jest/prefer-to-have-length": "warn",
3137
- "@typescript-eslint/no-require-imports": "off",
3138
- "jest/valid-expect": "off"
3139
3110
  }
3140
3111
  }
3141
3112
  ];
@@ -3148,7 +3119,14 @@ var override_default = [
3148
3119
  "prefer-const": 1,
3149
3120
  "prefer-destructuring": 1,
3150
3121
  "prefer-spread": 1,
3151
- "arrow-body-style": 0
3122
+ "arrow-body-style": 0,
3123
+ "react/display-name": 0,
3124
+ "react/prop-types": 0,
3125
+ "react/react-in-jsx-scope": 0,
3126
+ "react/jsx-uses-react": "error",
3127
+ "react/jsx-uses-vars": "error",
3128
+ "@typescript-eslint/no-unsafe-member-access": "off",
3129
+ "@typescript-eslint/no-unsafe-assignment": "off"
3152
3130
  }
3153
3131
  }
3154
3132
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evaneos/front-config",
3
- "version": "1.0.5",
3
+ "version": "1.2.0",
4
4
  "engines": {
5
5
  "node": ">=v18",
6
6
  "npm": ">=9"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../linting/eslint.config.ts","../linting/rules/react.ts","../linting/rules/test.ts","../linting/rules/override.ts"],"sourcesContent":["import eslintConfigPrettier from \"eslint-config-prettier\";\n\nimport eslint from \"@eslint/js\";\nimport tseslint from \"typescript-eslint\";\n\nimport reactLint from \"./rules/react\";\nimport testLint from \"./rules/test\";\nimport evaneosOverrides from \"./rules/override\";\n\nexport default tseslint.config(\n eslint.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n },\n {\n files: [\"**/*.js\", \"**/*.cjs\"],\n extends: [tseslint.configs.disableTypeChecked],\n },\n eslintConfigPrettier,\n testLint,\n ...reactLint,\n // custom evaneos rules\n ...evaneosOverrides\n);\n","import reactPlugin from \"eslint-plugin-react\";\n\nexport default [\n reactPlugin.configs.flat.recommended,\n reactPlugin.configs.flat[\"jsx-runtime\"],\n {\n rules: {\n \"react/display-name\": 0,\n \"react/prop-types\": 0,\n \"react/react-in-jsx-scope\": 0,\n },\n },\n];\n","import testingLibrary from \"eslint-plugin-testing-library\";\r\n\r\nexport default {\r\n files: [\"**/__tests__/**/*.[jt]s?(x)\", \"**/?(*.)+(spec|test).[jt]s?(x)\"],\r\n ...testingLibrary.configs[\"flat/react\"],\r\n};\r\n","export default [\n {\n rules: {\n \"no-process-env\": 0,\n \"prefer-const\": 1,\n \"prefer-destructuring\": 1,\n \"prefer-spread\": 1,\n \"arrow-body-style\": 0,\n },\n },\n] as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAiC;AAEjC,gBAAmB;AACnB,+BAAqB;;;ACHrB,iCAAwB;AAExB,IAAO,gBAAQ;AAAA,EACb,2BAAAA,QAAY,QAAQ,KAAK;AAAA,EACzB,2BAAAA,QAAY,QAAQ,KAAK,aAAa;AAAA,EACtC;AAAA,IACE,OAAO;AAAA,MACL,sBAAsB;AAAA,MACtB,oBAAoB;AAAA,MACpB,4BAA4B;AAAA,IAC9B;AAAA,EACF;AACF;;;ACZA,2CAA2B;AAE3B,IAAO,eAAQ;AAAA,EACb,OAAO,CAAC,+BAA+B,gCAAgC;AAAA,GACpE,qCAAAC,QAAe,QAAQ,YAAY;;;ACJxC,IAAO,mBAAQ;AAAA,EACb;AAAA,IACE,OAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAChB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,MACjB,oBAAoB;AAAA,IACtB;AAAA,EACF;AACF;;;AHDA,IAAO,wBAAQ,yBAAAC,QAAS;AAAA,EACtB,UAAAC,QAAO,QAAQ;AAAA,EACf,yBAAAD,QAAS,QAAQ;AAAA,EACjB;AAAA,IACE,iBAAiB;AAAA,MACf,eAAe;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB,QAAQ,IAAI;AAAA,MAC/B;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,WAAW,UAAU;AAAA,IAC7B,SAAS,CAAC,yBAAAA,QAAS,QAAQ,kBAAkB;AAAA,EAC/C;AAAA,EACA,8BAAAE;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EAEH,GAAG;AACL;","names":["reactPlugin","testingLibrary","tseslint","eslint","eslintConfigPrettier"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../linting/eslint.config.ts","../linting/rules/react.ts","../linting/rules/test.ts","../linting/rules/override.ts"],"sourcesContent":["import eslintConfigPrettier from \"eslint-config-prettier\";\n\nimport eslint from \"@eslint/js\";\nimport tseslint from \"typescript-eslint\";\n\nimport reactLint from \"./rules/react\";\nimport testLint from \"./rules/test\";\nimport evaneosOverrides from \"./rules/override\";\n\nexport default tseslint.config(\n eslint.configs.recommended,\n tseslint.configs.recommendedTypeChecked,\n {\n languageOptions: {\n parserOptions: {\n projectService: true,\n tsconfigRootDir: process.cwd(),\n },\n },\n },\n {\n files: [\"**/*.js\", \"**/*.cjs\"],\n extends: [tseslint.configs.disableTypeChecked],\n },\n eslintConfigPrettier,\n testLint,\n ...reactLint,\n // custom evaneos rules\n ...evaneosOverrides\n);\n","import reactPlugin from \"eslint-plugin-react\";\n\nexport default [\n reactPlugin.configs.flat.recommended,\n reactPlugin.configs.flat[\"jsx-runtime\"],\n {\n rules: {\n \"react/display-name\": 0,\n \"react/prop-types\": 0,\n \"react/react-in-jsx-scope\": 0,\n },\n },\n];\n","import testingLibrary from \"eslint-plugin-testing-library\";\r\n\r\nexport default {\r\n files: [\"**/__tests__/**/*.[jt]s?(x)\", \"**/?(*.)+(spec|test).[jt]s?(x)\"],\r\n ...testingLibrary.configs[\"flat/react\"],\r\n};\r\n","export default [\n {\n rules: {\n \"no-process-env\": 0,\n \"prefer-const\": 1,\n \"prefer-destructuring\": 1,\n \"prefer-spread\": 1,\n \"arrow-body-style\": 0,\n },\n },\n] as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,0BAA0B;AAEjC,OAAO,YAAY;AACnB,OAAO,cAAc;;;ACHrB,OAAO,iBAAiB;AAExB,IAAO,gBAAQ;AAAA,EACb,YAAY,QAAQ,KAAK;AAAA,EACzB,YAAY,QAAQ,KAAK,aAAa;AAAA,EACtC;AAAA,IACE,OAAO;AAAA,MACL,sBAAsB;AAAA,MACtB,oBAAoB;AAAA,MACpB,4BAA4B;AAAA,IAC9B;AAAA,EACF;AACF;;;ACZA,OAAO,oBAAoB;AAE3B,IAAO,eAAQ;AAAA,EACb,OAAO,CAAC,+BAA+B,gCAAgC;AAAA,GACpE,eAAe,QAAQ,YAAY;;;ACJxC,IAAO,mBAAQ;AAAA,EACb;AAAA,IACE,OAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,MAChB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,MACjB,oBAAoB;AAAA,IACtB;AAAA,EACF;AACF;;;AHDA,IAAO,wBAAQ,SAAS;AAAA,EACtB,OAAO,QAAQ;AAAA,EACf,SAAS,QAAQ;AAAA,EACjB;AAAA,IACE,iBAAiB;AAAA,MACf,eAAe;AAAA,QACb,gBAAgB;AAAA,QAChB,iBAAiB,QAAQ,IAAI;AAAA,MAC/B;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,WAAW,UAAU;AAAA,IAC7B,SAAS,CAAC,SAAS,QAAQ,kBAAkB;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EAEH,GAAG;AACL;","names":[]}