@atlaskit/eslint-plugin-platform 0.7.1 → 0.7.3
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/CHANGELOG.md +17 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/rules/ensure-critical-dependency-resolutions/index.js +4 -4
- package/dist/cjs/rules/ensure-feature-flag-prefix/index.js +2 -1
- package/dist/cjs/rules/ensure-native-and-af-exports-synced/index.js +3 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/rules/ensure-critical-dependency-resolutions/index.js +4 -4
- package/dist/es2019/rules/ensure-feature-flag-prefix/index.js +2 -1
- package/dist/es2019/rules/ensure-native-and-af-exports-synced/index.js +3 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/rules/ensure-critical-dependency-resolutions/index.js +4 -4
- package/dist/esm/rules/ensure-feature-flag-prefix/index.js +2 -1
- package/dist/esm/rules/ensure-native-and-af-exports-synced/index.js +3 -0
- package/index.js +1 -19
- package/package.json +3 -3
- package/src/index.tsx +1 -4
- package/src/rules/ensure-critical-dependency-resolutions/__test__/unit/rule.test.tsx +14 -14
- package/src/rules/ensure-critical-dependency-resolutions/index.tsx +4 -4
- package/src/rules/ensure-feature-flag-prefix/index.tsx +2 -1
- package/src/rules/ensure-native-and-af-exports-synced/index.tsx +3 -0
- package/tsconfig.app.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-platform
|
|
2
2
|
|
|
3
|
+
## 0.7.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122050](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122050)
|
|
8
|
+
[`db22dc84c34c3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/db22dc84c34c3) -
|
|
9
|
+
Moves away from the use of ts-node to esbuild-register for local consumption
|
|
10
|
+
|
|
11
|
+
## 0.7.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#116772](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116772)
|
|
16
|
+
[`46167815c5528`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/46167815c5528) -
|
|
17
|
+
Update feature flag prefix rule to be warn and recommend prefix only for deprecated launch darkly
|
|
18
|
+
flags.
|
|
19
|
+
|
|
3
20
|
## 0.7.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var configs = exports.configs = {
|
|
|
55
55
|
plugins: ['@atlaskit/platform'],
|
|
56
56
|
rules: {
|
|
57
57
|
'@atlaskit/platform/ensure-feature-flag-registration': 'error',
|
|
58
|
-
'@atlaskit/platform/ensure-feature-flag-prefix': ['
|
|
58
|
+
'@atlaskit/platform/ensure-feature-flag-prefix': ['warn', {
|
|
59
59
|
allowedPrefixes: ['platform.']
|
|
60
60
|
}],
|
|
61
61
|
'@atlaskit/platform/ensure-test-runner-arguments': 'error',
|
|
@@ -17,10 +17,10 @@ var DESIRED_PKG_VERSIONS = {
|
|
|
17
17
|
typescript: ['5.4'],
|
|
18
18
|
tslib: ['2.6'],
|
|
19
19
|
'@types/react': ['16.14', '18.2'],
|
|
20
|
-
'react-relay': ['npm:atl-react-relay@0.0.0-main-
|
|
21
|
-
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-
|
|
22
|
-
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-
|
|
23
|
-
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-
|
|
20
|
+
'react-relay': ['npm:atl-react-relay@0.0.0-main-5980a913'],
|
|
21
|
+
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-5980a913'],
|
|
22
|
+
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-5980a913'],
|
|
23
|
+
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-5980a913']
|
|
24
24
|
};
|
|
25
25
|
var matchMinorVersion = function matchMinorVersion(desiredVersion, versionInResolutions) {
|
|
26
26
|
var firstChar = versionInResolutions[0];
|
|
@@ -10,11 +10,12 @@ var _registrationUtils = require("../util/registration-utils");
|
|
|
10
10
|
var rule = {
|
|
11
11
|
meta: {
|
|
12
12
|
docs: {
|
|
13
|
+
url: 'http://go/pff-eslint',
|
|
13
14
|
recommended: false
|
|
14
15
|
},
|
|
15
16
|
type: 'problem',
|
|
16
17
|
messages: {
|
|
17
|
-
featureFlagIncorrectPrefix: "
|
|
18
|
+
featureFlagIncorrectPrefix: "Is this a LaunchDarkly feature flag? It needs a prefix so Confluence picks it up: [{{ allowedPrefixes }}]. Statsig feature gates don't need a prefix."
|
|
18
19
|
},
|
|
19
20
|
hasSuggestions: true,
|
|
20
21
|
schema: [{
|
package/dist/es2019/index.js
CHANGED
|
@@ -47,7 +47,7 @@ export const configs = {
|
|
|
47
47
|
plugins: ['@atlaskit/platform'],
|
|
48
48
|
rules: {
|
|
49
49
|
'@atlaskit/platform/ensure-feature-flag-registration': 'error',
|
|
50
|
-
'@atlaskit/platform/ensure-feature-flag-prefix': ['
|
|
50
|
+
'@atlaskit/platform/ensure-feature-flag-prefix': ['warn', {
|
|
51
51
|
allowedPrefixes: ['platform.']
|
|
52
52
|
}],
|
|
53
53
|
'@atlaskit/platform/ensure-test-runner-arguments': 'error',
|
|
@@ -10,10 +10,10 @@ const DESIRED_PKG_VERSIONS = {
|
|
|
10
10
|
typescript: ['5.4'],
|
|
11
11
|
tslib: ['2.6'],
|
|
12
12
|
'@types/react': ['16.14', '18.2'],
|
|
13
|
-
'react-relay': ['npm:atl-react-relay@0.0.0-main-
|
|
14
|
-
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-
|
|
15
|
-
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-
|
|
16
|
-
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-
|
|
13
|
+
'react-relay': ['npm:atl-react-relay@0.0.0-main-5980a913'],
|
|
14
|
+
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-5980a913'],
|
|
15
|
+
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-5980a913'],
|
|
16
|
+
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-5980a913']
|
|
17
17
|
};
|
|
18
18
|
const matchMinorVersion = (desiredVersion, versionInResolutions) => {
|
|
19
19
|
const firstChar = versionInResolutions[0];
|
|
@@ -4,11 +4,12 @@ import { getMetadataForFilename, getterIdentifierToFlagTypeMap } from '../util/r
|
|
|
4
4
|
const rule = {
|
|
5
5
|
meta: {
|
|
6
6
|
docs: {
|
|
7
|
+
url: 'http://go/pff-eslint',
|
|
7
8
|
recommended: false
|
|
8
9
|
},
|
|
9
10
|
type: 'problem',
|
|
10
11
|
messages: {
|
|
11
|
-
featureFlagIncorrectPrefix: `
|
|
12
|
+
featureFlagIncorrectPrefix: `Is this a LaunchDarkly feature flag? It needs a prefix so Confluence picks it up: [{{ allowedPrefixes }}]. Statsig feature gates don't need a prefix.`
|
|
12
13
|
},
|
|
13
14
|
hasSuggestions: true,
|
|
14
15
|
schema: [{
|
package/dist/esm/index.js
CHANGED
|
@@ -50,7 +50,7 @@ export var configs = {
|
|
|
50
50
|
plugins: ['@atlaskit/platform'],
|
|
51
51
|
rules: {
|
|
52
52
|
'@atlaskit/platform/ensure-feature-flag-registration': 'error',
|
|
53
|
-
'@atlaskit/platform/ensure-feature-flag-prefix': ['
|
|
53
|
+
'@atlaskit/platform/ensure-feature-flag-prefix': ['warn', {
|
|
54
54
|
allowedPrefixes: ['platform.']
|
|
55
55
|
}],
|
|
56
56
|
'@atlaskit/platform/ensure-test-runner-arguments': 'error',
|
|
@@ -11,10 +11,10 @@ var DESIRED_PKG_VERSIONS = {
|
|
|
11
11
|
typescript: ['5.4'],
|
|
12
12
|
tslib: ['2.6'],
|
|
13
13
|
'@types/react': ['16.14', '18.2'],
|
|
14
|
-
'react-relay': ['npm:atl-react-relay@0.0.0-main-
|
|
15
|
-
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-
|
|
16
|
-
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-
|
|
17
|
-
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-
|
|
14
|
+
'react-relay': ['npm:atl-react-relay@0.0.0-main-5980a913'],
|
|
15
|
+
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-5980a913'],
|
|
16
|
+
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-5980a913'],
|
|
17
|
+
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-5980a913']
|
|
18
18
|
};
|
|
19
19
|
var matchMinorVersion = function matchMinorVersion(desiredVersion, versionInResolutions) {
|
|
20
20
|
var firstChar = versionInResolutions[0];
|
|
@@ -4,11 +4,12 @@ import { getMetadataForFilename, getterIdentifierToFlagTypeMap } from '../util/r
|
|
|
4
4
|
var rule = {
|
|
5
5
|
meta: {
|
|
6
6
|
docs: {
|
|
7
|
+
url: 'http://go/pff-eslint',
|
|
7
8
|
recommended: false
|
|
8
9
|
},
|
|
9
10
|
type: 'problem',
|
|
10
11
|
messages: {
|
|
11
|
-
featureFlagIncorrectPrefix: "
|
|
12
|
+
featureFlagIncorrectPrefix: "Is this a LaunchDarkly feature flag? It needs a prefix so Confluence picks it up: [{{ allowedPrefixes }}]. Statsig feature gates don't need a prefix."
|
|
12
13
|
},
|
|
13
14
|
hasSuggestions: true,
|
|
14
15
|
schema: [{
|
package/index.js
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
/* eslint-disable global-require */
|
|
3
3
|
// Used only for internal repo usage.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const paths = require('tsconfig-paths');
|
|
7
|
-
|
|
8
|
-
if (!require.extensions['.ts']) {
|
|
9
|
-
// ts-node can only handle being registered once, see https://github.com/TypeStrong/ts-node/issues/409
|
|
10
|
-
require('ts-node').register({
|
|
11
|
-
project: path.join(__dirname, 'tsconfig.json'),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
// We programatically register tsconfig paths here so it picks up the tsconfig here
|
|
17
|
-
// instead of in root CWD.
|
|
18
|
-
paths.register(paths.loadConfig(__dirname));
|
|
19
|
-
} catch (e) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.log(e);
|
|
22
|
-
}
|
|
4
|
+
require('@atlassian/ts-loader/loader');
|
|
23
5
|
|
|
24
6
|
module.exports = require('./src/index');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-platform",
|
|
3
3
|
"description": "The essential plugin for use with Atlassian frontend platform tools",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"atlassian": {
|
|
7
7
|
"team": "UIP - Platform Integration Trust (PITa)",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"read-pkg-up": "^7.0.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@atlassian/ts-loader": "*",
|
|
39
40
|
"@types/eslint": "^8.56.6",
|
|
40
41
|
"eslint": "^8.49.0",
|
|
41
|
-
"outdent": "^0.5.0"
|
|
42
|
-
"tsconfig-paths": "^4.2.0"
|
|
42
|
+
"outdent": "^0.5.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/src/index.tsx
CHANGED
|
@@ -49,10 +49,7 @@ export const configs = {
|
|
|
49
49
|
plugins: ['@atlaskit/platform'],
|
|
50
50
|
rules: {
|
|
51
51
|
'@atlaskit/platform/ensure-feature-flag-registration': 'error',
|
|
52
|
-
'@atlaskit/platform/ensure-feature-flag-prefix': [
|
|
53
|
-
'error',
|
|
54
|
-
{ allowedPrefixes: ['platform.'] },
|
|
55
|
-
],
|
|
52
|
+
'@atlaskit/platform/ensure-feature-flag-prefix': ['warn', { allowedPrefixes: ['platform.'] }],
|
|
56
53
|
'@atlaskit/platform/ensure-test-runner-arguments': 'error',
|
|
57
54
|
'@atlaskit/platform/ensure-test-runner-nested-count': 'warn',
|
|
58
55
|
'@atlaskit/platform/no-invalid-feature-flag-usage': 'error',
|
|
@@ -13,10 +13,10 @@ describe('test ensure-critical-dependency-resolutions rule', () => {
|
|
|
13
13
|
"@types/react": "16.14.15",
|
|
14
14
|
"typescript": "5.4.2",
|
|
15
15
|
"tslib": "2.6.3",
|
|
16
|
-
"react-relay": "npm:atl-react-relay@0.0.0-main-
|
|
17
|
-
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-
|
|
18
|
-
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-
|
|
19
|
-
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-
|
|
16
|
+
"react-relay": "npm:atl-react-relay@0.0.0-main-5980a913",
|
|
17
|
+
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-5980a913",
|
|
18
|
+
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-5980a913",
|
|
19
|
+
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-5980a913",
|
|
20
20
|
}
|
|
21
21
|
}`,
|
|
22
22
|
filename: `${cwd}/package.json`,
|
|
@@ -28,10 +28,10 @@ describe('test ensure-critical-dependency-resolutions rule', () => {
|
|
|
28
28
|
"@types/react": "18.2.28",
|
|
29
29
|
"typescript": "5.4.2",
|
|
30
30
|
"tslib": "2.6.3",
|
|
31
|
-
"react-relay": "npm:atl-react-relay@0.0.0-main-
|
|
32
|
-
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-
|
|
33
|
-
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-
|
|
34
|
-
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-
|
|
31
|
+
"react-relay": "npm:atl-react-relay@0.0.0-main-5980a913",
|
|
32
|
+
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-5980a913",
|
|
33
|
+
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-5980a913",
|
|
34
|
+
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-5980a913",
|
|
35
35
|
}
|
|
36
36
|
}`,
|
|
37
37
|
filename: `${cwd}/package.json`,
|
|
@@ -43,10 +43,10 @@ describe('test ensure-critical-dependency-resolutions rule', () => {
|
|
|
43
43
|
"@types/react": "~16.14.25",
|
|
44
44
|
"typescript": "~5.4.2",
|
|
45
45
|
"tslib": "~2.6.3",
|
|
46
|
-
"react-relay": "npm:atl-react-relay@0.0.0-main-
|
|
47
|
-
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-
|
|
48
|
-
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-
|
|
49
|
-
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-
|
|
46
|
+
"react-relay": "npm:atl-react-relay@0.0.0-main-5980a913",
|
|
47
|
+
"relay-compiler": "npm:atl-relay-compiler@0.0.0-main-5980a913",
|
|
48
|
+
"relay-runtime": "npm:atl-relay-runtime@0.0.0-main-5980a913",
|
|
49
|
+
"relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-5980a913",
|
|
50
50
|
}
|
|
51
51
|
}`,
|
|
52
52
|
filename: `${cwd}/package.json`,
|
|
@@ -68,12 +68,12 @@ describe('test ensure-critical-dependency-resolutions rule', () => {
|
|
|
68
68
|
"resolutions": {
|
|
69
69
|
"@types/react": "~16.14.25",
|
|
70
70
|
"typescript": "~5.4.2",
|
|
71
|
-
"react-relay": "npm:atl-react-relay@0.0.0-main-
|
|
71
|
+
"react-relay": "npm:atl-react-relay@0.0.0-main-5980a913",
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@types/react": "~16.14.25",
|
|
75
75
|
"typescript": "~5.4.2",
|
|
76
|
-
"react-relay": "npm:atl-react-relay@0.0.0-main-
|
|
76
|
+
"react-relay": "npm:atl-react-relay@0.0.0-main-5980a913",
|
|
77
77
|
}
|
|
78
78
|
}`,
|
|
79
79
|
filename: `${cwd}/package.json`,
|
|
@@ -11,10 +11,10 @@ const DESIRED_PKG_VERSIONS: Record<string, string[]> = {
|
|
|
11
11
|
typescript: ['5.4'],
|
|
12
12
|
tslib: ['2.6'],
|
|
13
13
|
'@types/react': ['16.14', '18.2'],
|
|
14
|
-
'react-relay': ['npm:atl-react-relay@0.0.0-main-
|
|
15
|
-
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-
|
|
16
|
-
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-
|
|
17
|
-
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-
|
|
14
|
+
'react-relay': ['npm:atl-react-relay@0.0.0-main-5980a913'],
|
|
15
|
+
'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-5980a913'],
|
|
16
|
+
'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-5980a913'],
|
|
17
|
+
'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-5980a913'],
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const matchMinorVersion = (desiredVersion: string, versionInResolutions: string): boolean => {
|
|
@@ -9,11 +9,12 @@ type RuleOptions = {
|
|
|
9
9
|
const rule: Rule.RuleModule = {
|
|
10
10
|
meta: {
|
|
11
11
|
docs: {
|
|
12
|
+
url: 'http://go/pff-eslint',
|
|
12
13
|
recommended: false,
|
|
13
14
|
},
|
|
14
15
|
type: 'problem',
|
|
15
16
|
messages: {
|
|
16
|
-
featureFlagIncorrectPrefix: `
|
|
17
|
+
featureFlagIncorrectPrefix: `Is this a LaunchDarkly feature flag? It needs a prefix so Confluence picks it up: [{{ allowedPrefixes }}]. Statsig feature gates don't need a prefix.`,
|
|
17
18
|
},
|
|
18
19
|
hasSuggestions: true,
|
|
19
20
|
schema: [
|
|
@@ -14,6 +14,9 @@ const exportsValidationExceptions: ExportsValidationExceptions = {
|
|
|
14
14
|
'@atlaskit/tokens': {
|
|
15
15
|
ignoredAfExportKeys: ['./babel-plugin'],
|
|
16
16
|
},
|
|
17
|
+
'@atlaskit/storybook-addon-design-system': {
|
|
18
|
+
ignoredAfExportKeys: ['.'],
|
|
19
|
+
},
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
const rule: Rule.RuleModule = {
|
package/tsconfig.app.json
CHANGED