@next/eslint-plugin-next 15.3.0-canary.8 → 15.3.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 (2) hide show
  1. package/dist/index.js +77 -30
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,62 @@
1
1
  "use strict";
2
- module.exports = {
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ var recommendedRules = {
31
+ // warnings
32
+ '@next/next/google-font-display': 'warn',
33
+ '@next/next/google-font-preconnect': 'warn',
34
+ '@next/next/next-script-for-ga': 'warn',
35
+ '@next/next/no-async-client-component': 'warn',
36
+ '@next/next/no-before-interactive-script-outside-document': 'warn',
37
+ '@next/next/no-css-tags': 'warn',
38
+ '@next/next/no-head-element': 'warn',
39
+ '@next/next/no-html-link-for-pages': 'warn',
40
+ '@next/next/no-img-element': 'warn',
41
+ '@next/next/no-page-custom-font': 'warn',
42
+ '@next/next/no-styled-jsx-in-document': 'warn',
43
+ '@next/next/no-sync-scripts': 'warn',
44
+ '@next/next/no-title-in-document-head': 'warn',
45
+ '@next/next/no-typos': 'warn',
46
+ '@next/next/no-unwanted-polyfillio': 'warn',
47
+ // errors
48
+ '@next/next/inline-script-id': 'error',
49
+ '@next/next/no-assign-module-variable': 'error',
50
+ '@next/next/no-document-import-in-page': 'error',
51
+ '@next/next/no-duplicate-head': 'error',
52
+ '@next/next/no-head-import-in-document': 'error',
53
+ '@next/next/no-script-component-in-head': 'error'
54
+ };
55
+ var coreWebVitalsRules = {
56
+ '@next/next/no-html-link-for-pages': 'error',
57
+ '@next/next/no-sync-scripts': 'error'
58
+ };
59
+ var plugin = {
3
60
  rules: {
4
61
  'google-font-display': require('./rules/google-font-display'),
5
62
  'google-font-preconnect': require('./rules/google-font-preconnect'),
@@ -28,31 +85,7 @@ module.exports = {
28
85
  plugins: [
29
86
  '@next/next'
30
87
  ],
31
- rules: {
32
- // warnings
33
- '@next/next/google-font-display': 'warn',
34
- '@next/next/google-font-preconnect': 'warn',
35
- '@next/next/next-script-for-ga': 'warn',
36
- '@next/next/no-async-client-component': 'warn',
37
- '@next/next/no-before-interactive-script-outside-document': 'warn',
38
- '@next/next/no-css-tags': 'warn',
39
- '@next/next/no-head-element': 'warn',
40
- '@next/next/no-html-link-for-pages': 'warn',
41
- '@next/next/no-img-element': 'warn',
42
- '@next/next/no-page-custom-font': 'warn',
43
- '@next/next/no-styled-jsx-in-document': 'warn',
44
- '@next/next/no-sync-scripts': 'warn',
45
- '@next/next/no-title-in-document-head': 'warn',
46
- '@next/next/no-typos': 'warn',
47
- '@next/next/no-unwanted-polyfillio': 'warn',
48
- // errors
49
- '@next/next/inline-script-id': 'error',
50
- '@next/next/no-assign-module-variable': 'error',
51
- '@next/next/no-document-import-in-page': 'error',
52
- '@next/next/no-duplicate-head': 'error',
53
- '@next/next/no-head-import-in-document': 'error',
54
- '@next/next/no-script-component-in-head': 'error'
55
- }
88
+ rules: recommendedRules
56
89
  },
57
90
  'core-web-vitals': {
58
91
  plugins: [
@@ -61,10 +94,24 @@ module.exports = {
61
94
  extends: [
62
95
  'plugin:@next/next/recommended'
63
96
  ],
64
- rules: {
65
- '@next/next/no-html-link-for-pages': 'error',
66
- '@next/next/no-sync-scripts': 'error'
67
- }
97
+ rules: coreWebVitalsRules
68
98
  }
69
99
  }
70
100
  };
101
+ module.exports = plugin;
102
+ module.exports.flatConfig = {
103
+ recommended: {
104
+ name: 'next/recommended',
105
+ plugins: {
106
+ '@next/next': plugin
107
+ },
108
+ rules: recommendedRules
109
+ },
110
+ coreWebVitals: {
111
+ name: 'next/core-web-vitals',
112
+ plugins: {
113
+ '@next/next': plugin
114
+ },
115
+ rules: _object_spread({}, recommendedRules, coreWebVitalsRules)
116
+ }
117
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/eslint-plugin-next",
3
- "version": "15.3.0-canary.8",
3
+ "version": "15.3.0",
4
4
  "description": "ESLint plugin for Next.js.",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",