@4mbl/lint 0.0.0-alpha.c07b435 → 0.0.0-alpha.d2c640f

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/next.js CHANGED
@@ -2,50 +2,62 @@ import path from 'node:path';
2
2
  import process from 'node:process';
3
3
  import { defineConfig } from 'oxlint';
4
4
  import { reactConfig } from './react.js';
5
- import reactRefresh from 'eslint-plugin-react-refresh';
6
5
  const DEFAULT_OPTIONS = { uiPath: 'src/components/ui/' };
7
6
  function nextConfig(options) {
8
7
  const opts = { ...DEFAULT_OPTIONS, ...options };
8
+ const react = reactConfig(options);
9
9
  return defineConfig({
10
- extends: [reactConfig(options)],
11
- plugins: ['nextjs'],
10
+ extends: [react],
11
+ plugins: [...react.plugins, 'nextjs'],
12
12
  rules: {
13
- '@next/next/google-font-display': 'warn',
14
- '@next/next/google-font-preconnect': 'warn',
15
- '@next/next/next-script-for-ga': 'warn',
16
- '@next/next/no-async-client-component': 'warn',
17
- '@next/next/no-before-interactive-script-outside-document': 'warn',
18
- '@next/next/no-css-tags': 'warn',
19
- '@next/next/no-head-element': 'warn',
20
- '@next/next/no-html-link-for-pages': 'error',
21
- '@next/next/no-page-custom-font': 'warn',
22
- '@next/next/no-styled-jsx-in-document': 'warn',
23
- '@next/next/no-sync-scripts': 'error',
24
- '@next/next/no-title-in-document-head': 'warn',
25
- '@next/next/no-typos': 'warn',
26
- '@next/next/no-unwanted-polyfillio': 'warn',
27
- '@next/next/inline-script-id': 'error',
28
- '@next/next/no-assign-module-variable': 'error',
29
- '@next/next/no-document-import-in-page': 'error',
30
- '@next/next/no-duplicate-head': 'error',
31
- '@next/next/no-head-import-in-document': 'error',
32
- '@next/next/no-script-component-in-head': 'error',
33
- },
34
- ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
35
- overrides: [
13
+ 'nextjs/google-font-display': 'warn',
14
+ 'nextjs/google-font-preconnect': 'warn',
15
+ 'nextjs/next-script-for-ga': 'warn',
16
+ 'nextjs/no-async-client-component': 'warn',
17
+ 'nextjs/no-before-interactive-script-outside-document': 'warn',
18
+ 'nextjs/no-css-tags': 'warn',
19
+ 'nextjs/no-head-element': 'warn',
20
+ 'nextjs/no-html-link-for-pages': 'error',
21
+ 'nextjs/no-page-custom-font': 'warn',
22
+ 'nextjs/no-styled-jsx-in-document': 'warn',
23
+ 'nextjs/no-sync-scripts': 'error',
24
+ 'nextjs/no-title-in-document-head': 'warn',
25
+ 'nextjs/no-typos': 'warn',
26
+ 'nextjs/no-unwanted-polyfillio': 'warn',
27
+ 'nextjs/inline-script-id': 'error',
28
+ 'nextjs/no-assign-module-variable': 'error',
29
+ 'nextjs/no-document-import-in-page': 'error',
30
+ 'nextjs/no-duplicate-head': 'error',
31
+ 'nextjs/no-head-import-in-document': 'error',
32
+ 'nextjs/no-script-component-in-head': 'error',
36
33
  // ignores warnings for special exports in page and layout files
37
- // https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#next-config
38
- {
39
- files: ['**/*.{js,jsx,mjs,ts,tsx,mts,cts}'],
40
- rules: {
41
- 'react-refresh-js/only-export-components': [
42
- 'error',
43
- {
44
- allowExportNames: reactRefresh.configs.next.rules['react-refresh/only-export-components'][1]['allowExportNames'],
45
- },
34
+ 'react/only-export-components': [
35
+ 'warn',
36
+ {
37
+ // https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/src/index.ts
38
+ allowExportNames: [
39
+ // removed in next@16.0.0: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#version-history
40
+ // 'experimental_ppr',
41
+ 'dynamic',
42
+ 'dynamicParams',
43
+ 'revalidate',
44
+ 'fetchCache',
45
+ 'runtime',
46
+ 'preferredRegion',
47
+ 'maxDuration',
48
+ 'metadata',
49
+ 'generateMetadata',
50
+ 'viewport',
51
+ 'generateViewport',
52
+ 'generateImageMetadata',
53
+ 'generateSitemaps',
54
+ 'generateStaticParams',
46
55
  ],
47
56
  },
48
- },
57
+ ],
58
+ },
59
+ ignorePatterns: ['.next/**', 'out/**', 'build/**', 'next-env.d.ts'],
60
+ overrides: [
49
61
  opts.uiPath === null
50
62
  ? { files: [], rules: {} }
51
63
  : {
@@ -53,7 +65,7 @@ function nextConfig(options) {
53
65
  `${path.resolve(process.cwd(), opts.uiPath)}/**/*.{js,jsx,mjs,ts,tsx,mts,cts}`.replaceAll('//', '/'),
54
66
  ],
55
67
  rules: {
56
- 'react-refresh-js/only-export-components': 'off',
68
+ 'react/only-export-components': 'off',
57
69
  },
58
70
  },
59
71
  ],
package/dist/next.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAqB,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAqB,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAcvD,MAAM,eAAe,GAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;AAEtE,SAAS,UAAU,CAAC,OAA8B;IAChD,MAAM,IAAI,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;IAEhD,OAAO,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,KAAK,EAAE;YACL,gCAAgC,EAAE,MAAM;YACxC,mCAAmC,EAAE,MAAM;YAC3C,+BAA+B,EAAE,MAAM;YACvC,sCAAsC,EAAE,MAAM;YAC9C,0DAA0D,EAAE,MAAM;YAClE,wBAAwB,EAAE,MAAM;YAChC,4BAA4B,EAAE,MAAM;YACpC,mCAAmC,EAAE,OAAO;YAC5C,gCAAgC,EAAE,MAAM;YACxC,sCAAsC,EAA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