eslint-plugin-use-agnostic 0.3.2 → 0.4.1

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
@@ -2,4 +2,53 @@
2
2
 
3
3
  eslint-plugin-use-agnostic highlights problematic server-client imports in projects made with the Fullstack React Architecture (Next.js App Router, etc.) based on each of their modules' derived effective directives through detailed import rule violations, thanks to the introduction of its very own 'use agnostic' directive.
4
4
 
5
- ![Intro example of linting with the use-agnostic ESLint plugin including the suggestion to use the 'use agnostic' directive.](./assets/README/intro-screenshot.png)
5
+ ![Intro example of linting with the use-agnostic ESLint plugin including the suggestion to use the 'use agnostic' directive.](./assets/README/example-screenshot.png)
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ npm install eslint@^9.0.0 eslint-plugin-use-agnostic --save-dev
11
+ ```
12
+
13
+ ## Setup (using TypeScript and the Flat Config)
14
+
15
+ ```js
16
+ // eslint.config.js
17
+
18
+ import { defineConfig, globalIgnores } from "eslint/config";
19
+ import tseslint from "typescript-eslint"; // for compatibility with TypeScript, not included as a devDependency
20
+
21
+ import useAgnostic, {
22
+ useAgnosticPluginName,
23
+ agnostic20ConfigName,
24
+ } from "eslint-plugin-use-agnostic"; // no declaration file at this time
25
+
26
+ export default defineConfig([
27
+ globalIgnores([".next", ".react-router", "node_modules"]),
28
+ {
29
+ // files: ['**/*.js', '**/*.jsx'], // if you're using vanilla JavaScript
30
+ files: ["**/*.ts", "**/*.tsx"],
31
+ plugins: {
32
+ [useAgnosticPluginName]: useAgnostic,
33
+ },
34
+ extends: [`${useAgnosticPluginName}/${agnostic20ConfigName}`],
35
+ languageOptions: {
36
+ parser: tseslint.parser, // for compatibility with .ts and .tsx
37
+ },
38
+ },
39
+ ]);
40
+ ```
41
+
42
+ And don't forget the VS Code settings via `./.vscode/settings.json`:
43
+
44
+ ```json
45
+ {
46
+ "eslint.useFlatConfig": true,
47
+ "eslint.validate": [
48
+ "javascript",
49
+ "javascriptreact",
50
+ "typescript",
51
+ "typescriptreact"
52
+ ]
53
+ }
54
+ ```
@@ -88,7 +88,7 @@ const makeIntroForSpecificViolationMessage = (
88
88
  );
89
89
 
90
90
  const SUGGEST_USE_AGNOSTIC =
91
- "If the module you're trying to import does not possess any server-side code however, please mark it with the 'use agnostic' directive to make it compatible across all environments.";
91
+ "If the module you're trying to import does not possess any server-side code however, please mark it with this plugin's own and eponymous 'use agnostic' directive to signal its compatibility across all environments.";
92
92
 
93
93
  export const effectiveDirectives_BlockedImports = Object.freeze({
94
94
  [USE_SERVER_LOGICS]: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",