@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 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': ['error', {
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-2ccd6998'],
21
- 'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-2ccd6998'],
22
- 'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-2ccd6998'],
23
- 'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-2ccd6998']
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: "Please change your flag \"{{ featureFlag }}\" to have a valid prefix, options are [{{ allowedPrefixes }}]. See http://go/pff-eslint for details"
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: [{
@@ -18,6 +18,9 @@ var exportsValidationExceptions = {
18
18
  },
19
19
  '@atlaskit/tokens': {
20
20
  ignoredAfExportKeys: ['./babel-plugin']
21
+ },
22
+ '@atlaskit/storybook-addon-design-system': {
23
+ ignoredAfExportKeys: ['.']
21
24
  }
22
25
  };
23
26
  var rule = {
@@ -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': ['error', {
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-2ccd6998'],
14
- 'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-2ccd6998'],
15
- 'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-2ccd6998'],
16
- 'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-2ccd6998']
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: `Please change your flag "{{ featureFlag }}" to have a valid prefix, options are [{{ allowedPrefixes }}]. See http://go/pff-eslint for details`
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: [{
@@ -6,6 +6,9 @@ const exportsValidationExceptions = {
6
6
  },
7
7
  '@atlaskit/tokens': {
8
8
  ignoredAfExportKeys: ['./babel-plugin']
9
+ },
10
+ '@atlaskit/storybook-addon-design-system': {
11
+ ignoredAfExportKeys: ['.']
9
12
  }
10
13
  };
11
14
  const rule = {
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': ['error', {
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-2ccd6998'],
15
- 'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-2ccd6998'],
16
- 'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-2ccd6998'],
17
- 'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-2ccd6998']
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: "Please change your flag \"{{ featureFlag }}\" to have a valid prefix, options are [{{ allowedPrefixes }}]. See http://go/pff-eslint for details"
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: [{
@@ -11,6 +11,9 @@ var exportsValidationExceptions = {
11
11
  },
12
12
  '@atlaskit/tokens': {
13
13
  ignoredAfExportKeys: ['./babel-plugin']
14
+ },
15
+ '@atlaskit/storybook-addon-design-system': {
16
+ ignoredAfExportKeys: ['.']
14
17
  }
15
18
  };
16
19
  var rule = {
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
- const path = require('path');
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.1",
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-2ccd6998",
17
- "relay-compiler": "npm:atl-relay-compiler@0.0.0-main-2ccd6998",
18
- "relay-runtime": "npm:atl-relay-runtime@0.0.0-main-2ccd6998",
19
- "relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-2ccd6998",
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-2ccd6998",
32
- "relay-compiler": "npm:atl-relay-compiler@0.0.0-main-2ccd6998",
33
- "relay-runtime": "npm:atl-relay-runtime@0.0.0-main-2ccd6998",
34
- "relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-2ccd6998",
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-2ccd6998",
47
- "relay-compiler": "npm:atl-relay-compiler@0.0.0-main-2ccd6998",
48
- "relay-runtime": "npm:atl-relay-runtime@0.0.0-main-2ccd6998",
49
- "relay-test-utils": "npm:atl-relay-test-utils@0.0.0-main-2ccd6998",
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-2ccd6998",
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-2ccd6998",
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-2ccd6998'],
15
- 'relay-compiler': ['npm:atl-relay-compiler@0.0.0-main-2ccd6998'],
16
- 'relay-runtime': ['npm:atl-relay-runtime@0.0.0-main-2ccd6998'],
17
- 'relay-test-utils': ['npm:atl-relay-test-utils@0.0.0-main-2ccd6998'],
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: `Please change your flag "{{ featureFlag }}" to have a valid prefix, options are [{{ allowedPrefixes }}]. See http://go/pff-eslint for details`,
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
@@ -32,6 +32,10 @@
32
32
  "composite": true,
33
33
  "outDir": "../../../tsDist/@atlaskit__eslint-plugin-platform/app"
34
34
  },
35
- "references": [],
35
+ "references": [
36
+ {
37
+ "path": "../../monorepo-tooling/ts-loader/tsconfig.app.json"
38
+ }
39
+ ],
36
40
  "files": []
37
41
  }