eslint-config-tungsten-js-flat 0.3.0 → 0.3.2

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/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export type { ReactFlatConfig } from 'eslint-plugin-react';
2
- export type { Linter } from 'eslint';
3
1
  declare const _default: import("eslint/config").Config[];
4
2
  export default _default;
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;;AAEpC,wBAkJE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAQA,wBAUE"}
package/dist/index.js CHANGED
@@ -1,142 +1,16 @@
1
- import globals from 'globals';
2
- import pluginJs from '@eslint/js';
3
- import pluginReact from 'eslint-plugin-react';
4
- import stylistic from '@stylistic/eslint-plugin';
1
+ import tungstenBase from 'eslint-config-tungsten-base-flat';
5
2
  import pluginImportX from 'eslint-plugin-import-x';
6
3
  import { defineConfig } from 'eslint/config';
4
+ // The base plus import-x. Kept separate from the base so the TS config can take the
5
+ // base alone and avoid import-x's native resolver (and pnpm's ignored-build warning).
7
6
  export default defineConfig([
8
- { files: ["**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}"] },
9
- { languageOptions: {
10
- globals: {
11
- ...globals.browser,
12
- ...globals.node,
13
- Sass: true,
14
- Scss: true,
15
- Css: true
16
- }
17
- } },
18
- pluginJs.configs.recommended,
19
- pluginReact.configs.flat.recommended, // dumb funkers typed their flat config repository as Record<string, ReactFlatConfig>
7
+ ...tungstenBase,
20
8
  {
21
- "plugins": {
22
- "@stylistic": stylistic,
9
+ plugins: {
23
10
  "import-x": pluginImportX,
24
11
  },
25
- "rules": {
26
- //// errors or likely errors
27
- "no-undef": ["error", { "typeof": true }],
28
- "no-import-assign": "error",
29
- "no-unexpected-multiline": "error",
30
- "no-fallthrough": "error",
31
- "no-unsafe-negation": "error",
32
- "no-restricted-globals": [
33
- "error",
34
- {
35
- "name": "__dirname",
36
- "message": "__dirname does not exist in ES6 modules. Extract dirname from import.meta.url."
37
- },
38
- {
39
- "name": "require",
40
- "message": "require does not exist in ES6 modules. Use import { createRequire } from 'module'; const require = createRequire(import.meta.url) if you need require."
41
- },
42
- {
43
- "name": "module",
44
- "message": "module does not exist in ES6 modules. Use export if trying to export from ES6 modules."
45
- },
46
- {
47
- "name": "exports",
48
- "message": "exports does not exist in ES6 modules. Use export to export from ES6 modules."
49
- },
50
- // add extra objects here, they are not stored within an array. weird.
51
- ],
12
+ rules: {
52
13
  "import-x/extensions": ["error", "always"],
53
- //// safety
54
- //"import/no-default-export": "warn", // too restrictive, disabled
55
- "no-case-declarations": "warn", // warn about declaring variables in switch blocks due to scoping issues
56
- "no-cond-assign": "warn", // assigning to a variable with = instead an if or other check. Allowed but warned
57
- "eqeqeq": "warn", // suggest === instead of ==
58
- //// maintenance
59
- "no-console": "warn", // suggest not using console.log, instead using custom functions
60
- // allowing debug and output to be intercepted later
61
- //// inefficiencies
62
- "no-unreachable": "warn",
63
- //"no-return-await": "warn",
64
- "no-unused-vars": ["warn", {
65
- "argsIgnorePattern": "^(?:_|req|request|res|response|next|resolve|reject)$",
66
- "ignoreRestSiblings": true
67
- }],
68
- "no-constant-condition": "warn", // enabled by eslint:recommended. Not sure whether to keep
69
- "no-self-assign": "warn",
70
- //// information
71
- "prefer-const": "warn",
72
- "no-useless-escape": "warn", // will turn to off eventually // came from eslint:recommended
73
- //// style
74
- "@stylistic/semi": ["warn", "never"], // semi-colons
75
- "@stylistic/indent": ["warn", 4, {
76
- "SwitchCase": 1, // indent switch contents by 1 indent
77
- "MemberExpression": "off", // .then .catch etc chained methods - off to allow dev style?
78
- "ignoreComments": true
79
- }],
80
- //"@stylistic/no-mixed-spaces-and-tabs": "warn",
81
- "@stylistic/no-trailing-spaces": ["warn", {
82
- "skipBlankLines": true,
83
- "ignoreComments": true
84
- }],
85
- "@stylistic/quotes": ["warn", "single"],
86
- //// minor style
87
- "@stylistic/keyword-spacing": ["warn", {
88
- "overrides": {
89
- "catch": { "after": true } // after catch
90
- }
91
- }],
92
- "object-shorthand": ["warn", "properties"], // use { prop } instead of { prop : prop }. But don't require { a() } instead of { a: function() }
93
- "@stylistic/max-len": ["warn", 120, {
94
- "ignoreComments": true,
95
- //"ignoreStrings": true, // too eager
96
- }], // maximum 120 chars per line
97
- "@stylistic/brace-style": ["warn", "1tbs", { "allowSingleLine": true }], // { } rules
98
- "camelcase": ["warn", {
99
- "allow": ["^(db|DB|mongo|MONGO|mysql|MYSQL|postgres?|POSTGRES?)_"],
100
- "ignoreGlobals": true
101
- }], // camelCase variables
102
- "@stylistic/eol-last": ["warn", "always"],
103
- // disabling/softening default eslint rules rules
104
- "no-inner-declarations": "warn",
105
- "no-async-promise-executor": "warn",
106
- "no-useless-catch": "warn",
107
- "no-func-assign": "off",
108
- "no-empty": "off",
109
- // replace ban-types -- not supported in this version of eslint
110
- // "ban-types": "off",
111
- // "no-empty-object-type": "off",
112
- // "no-unsafe-function-type": "warn",
113
- // "no-wrapper-object-types": "warn",
114
- // former active rules
115
- "consistent-return": "off",
116
- "require-await": "off", // warn if async funcs don't have an await
117
- //// React rules
118
- 'react/react-in-jsx-scope': 'off', // don't require React to be defined ...
119
- "react/prop-types": "off",
120
- "react/self-closing-comp": "warn",
121
- "react/no-direct-mutation-state": "off", // we mutate state now
122
- "react/no-unknown-property": ["warn", { ignore: ['bind', 'filter', 'css'] }],
123
- "react/no-unescaped-entities": "off", // I think we handle HTML entities already
124
14
  },
125
15
  },
126
- {
127
- "files": ["**/*.cjs"],
128
- "rules": {
129
- "no-restricted-globals": ["error", ""]
130
- }
131
- },
132
- {
133
- // Pinned, not 'detect': tungsten uses eslint-plugin-react for JSX linting without
134
- // React installed, so detection warns on every run - and on eslint 10 it throws
135
- // (contextOrFilename.getFilename is not a function in the plugin's version.js).
136
- settings: {
137
- react: {
138
- version: '18.3.1',
139
- },
140
- }
141
- }
142
16
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-tungsten-js-flat",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -11,14 +11,11 @@
11
11
  "author": "",
12
12
  "license": "UNLICENSED",
13
13
  "dependencies": {
14
- "@eslint/js": "^10.0.1",
15
- "@stylistic/eslint-plugin": "^5.10.0",
16
- "eslint-plugin-import-x": "^4.17.1",
17
- "eslint-plugin-react": "^7.37.5",
18
- "globals": "^15.15.0"
14
+ "eslint-config-tungsten-base-flat": "^0.3.1",
15
+ "eslint-plugin-import-x": "^4.17.1"
19
16
  },
20
17
  "peerDependencies": {
21
- "eslint": "^9.0.0 || ^10.0.0"
18
+ "eslint": "^9.0.0"
22
19
  },
23
20
  "__OldPeerDependencies": {
24
21
  "@babel/core": "^7.16.0",
@@ -28,7 +25,7 @@
28
25
  "eslint-plugin-react-hooks": "^5.2.0"
29
26
  },
30
27
  "devDependencies": {
31
- "@types/node": "^22.19.15",
28
+ "@types/node": "^22.20.1",
32
29
  "typescript": "^5.9.3"
33
30
  },
34
31
  "scripts": {