eslint-plugin-gamut 3.0.3-alpha.8432ac.0 → 3.0.3-alpha.935e74.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.
@@ -0,0 +1,4 @@
1
+ eslint-plugin-gamut:build: cache hit, replaying output 1cb6669ce44ddc1f
2
+ eslint-plugin-gamut:build: $ yarn build:clean && yarn build:compile
3
+ eslint-plugin-gamut:build: $ rm -rf dist
4
+ eslint-plugin-gamut:build: $ tsc
package/CHANGELOG.md CHANGED
@@ -3,6 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ### 3.0.3-alpha.8432ac.0 (2022-01-28)
6
+ ### 3.0.3-alpha.935e74.0 (2022-02-04)
7
7
 
8
8
  **Note:** Version bump only for package eslint-plugin-gamut
package/README.md CHANGED
@@ -1,18 +1,21 @@
1
- # `gamut-tests`
1
+ # `eslint-plugin-gamut`
2
2
 
3
- Shared component test setup for Gamut applications. ✨
4
-
5
- A wrapper around [`component-test-setup`](https://github.com/Codecademy/component-test-setup) that wraps the node with an `@emotion/react`+`gamut-styles` `<ThemeProvider theme={theme}>`.
6
- Use this instead of `component-test-setup` to test Gamut components in Gamut apps!
3
+ Recommended eslint plugin for Gamut applications. ✨
7
4
 
8
5
  ## Usage
9
6
 
10
- The API is functionally the same `component-test-setup`:
11
-
12
7
  ```tsx
13
- import { setupRtl } from '@codecademy/gamut-tests';
8
+ // eslintrc.js
9
+
10
+ module.exports = {
11
+ root: true,
14
12
 
15
- const renderView = setupRtl(MyComponent, { prop: true });
13
+ plugins: ['eslint-plugin-gamut'],
16
14
 
17
- const { view } = renderView();
15
+ rules: {
16
+ 'gamut/prefer-themed': 'error',
17
+ 'gamut/no-css-standalone': 'error',
18
+ 'gamut/import-paths': 'error',
19
+ },
20
+ };
18
21
  ```
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createRule = void 0;
4
4
  const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
5
- exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator(name => `https://example.com/rule/${name}`);
5
+ exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator((name) => `https://example.com/rule/${name}`);
6
6
  //# sourceMappingURL=createRule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRule.js","sourceRoot":"","sources":["../src/createRule.ts"],"names":[],"mappings":";;;AAAA,8EAAoE;AAEvD,QAAA,UAAU,GAAG,gCAAW,CAAC,WAAW,CAC/C,IAAI,CAAC,EAAE,CAAC,4BAA4B,IAAI,EAAE,CAC3C,CAAC"}
1
+ {"version":3,"file":"createRule.js","sourceRoot":"","sources":["../src/createRule.ts"],"names":[],"mappings":";;;AAAA,8EAAoE;AAEvD,QAAA,UAAU,GAAG,gCAAW,CAAC,WAAW,CAC/C,CAAC,IAAI,EAAE,EAAE,CAAC,4BAA4B,IAAI,EAAE,CAC7C,CAAC"}
@@ -19,9 +19,11 @@ exports.default = (0, createRule_1.createRule)({
19
19
  if (importPath.includes('/src')) {
20
20
  const indexOfSrc = node.source.range[0] + importPath.search('/src');
21
21
  context.report({
22
- ...(importPath.endsWith('/src') && { fix: (fixer) => {
22
+ ...(importPath.endsWith('/src') && {
23
+ fix: (fixer) => {
23
24
  return fixer.removeRange([indexOfSrc + 1, node.range[1] - 2]);
24
- } }),
25
+ },
26
+ }),
25
27
  messageId: 'removeSrc',
26
28
  node,
27
29
  });
@@ -30,9 +32,11 @@ exports.default = (0, createRule_1.createRule)({
30
32
  if (importPath.includes('/dist')) {
31
33
  const indexOfDist = node.source.range[0] + importPath.search('/dist');
32
34
  context.report({
33
- ...(importPath.endsWith('/dist')) && { fix: (fixer) => {
35
+ ...(importPath.endsWith('/dist') && {
36
+ fix: (fixer) => {
34
37
  return fixer.removeRange([indexOfDist + 1, node.range[1] - 2]);
35
- } },
38
+ },
39
+ }),
36
40
  messageId: 'remove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;wBACb,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;4BAClC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;gCACb,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,WAAW,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;4BACjE,CAAC;yBACF,CAAC;wBACF,SAAS,EAAE,YAAY;wBACvB,IAAI;qBACL,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;IACD,cAAc,EAAE,EAAE;IAClB,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,0DAA0D;YACvE,WAAW,EAAE,OAAO;SACrB;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACR,UAAU,EACR,kEAAkE;YACpE,SAAS,EACP,iEAAiE;YACnE,iBAAiB,EAAE,gDAAgD;SACpE;QACD,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,EAAE;KACX;IACD,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC"}
package/jest.config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  module.exports = require('../../jest.config.base')('eslint-plugin-gamut', {
2
+ testEnvironment: 'node',
2
3
  setupFiles: [],
3
4
  setupFilesAfterEnv: [],
4
5
  });
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "gamut-styles"
9
9
  ],
10
10
  "name": "eslint-plugin-gamut",
11
- "version": "3.0.3-alpha.8432ac.0",
11
+ "version": "3.0.3-alpha.935e74.0",
12
12
  "license": "MIT",
13
13
  "main": "./dist/index.js",
14
14
  "module": "dist/index.js",
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@types/eslint": "^8.2.1"
37
37
  },
38
- "gitHead": "97a90092a9f75f47629987e0df8372037e4ff84a"
38
+ "gitHead": "d257aa4cfd94595db97710761cc63e029a86d662"
39
39
  }