@justeattakeaway/stylelint-config-pie 0.3.0 → 0.4.1

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/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ .turbo
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [Removed] - CODE_OF_CONDUCT.md files in favour of the one at the monorepo root ([#841](https://github.com/justeattakeaway/pie/pull/841)) by [@xander-marjoram](https://github.com/xander-marjoram)
8
+
9
+ ## 0.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [Added] - Rule for custom property naming convention ([#550](https://github.com/justeattakeaway/pie/pull/550)) by [@ashleynolan](https://github.com/ashleynolan)
14
+
3
15
  ## 0.3.0
4
16
 
5
17
  ### Minor Changes
@@ -15,13 +15,13 @@ describe('base Stylelint rules', () => {
15
15
  beforeEach(() => {
16
16
  result = stylelint.lint({
17
17
  code: validCSS,
18
- config: baseConfig
18
+ config: baseConfig,
19
19
  });
20
20
  });
21
21
 
22
- it('did not error', () => result.then(data => expect(data.errored).toBeFalsy()));
22
+ it('did not error', () => result.then((data) => expect(data.errored).toBeFalsy()));
23
23
 
24
- it('flags no warnings', () => result.then(data => (
24
+ it('flags no warnings', () => result.then((data) => (
25
25
  expect(data.results[0].warnings.length).toBe(0)
26
26
  )));
27
27
  });
@@ -38,35 +38,35 @@ describe('base Stylelint rules', () => {
38
38
  beforeEach(() => {
39
39
  result = stylelint.lint({
40
40
  code: invalidCSS,
41
- config: baseConfig
41
+ config: baseConfig,
42
42
  });
43
43
  });
44
44
 
45
- it('did error', () => result.then(data => (
45
+ it('did error', () => result.then((data) => (
46
46
  expect(data.errored).toBeTruthy()
47
47
  )));
48
48
 
49
- it('flags one warning', () => result.then(data => (
49
+ it('flags one warning', () => result.then((data) => (
50
50
  expect(data.results[0].warnings.length).toBe(1)
51
51
  )));
52
52
 
53
- it('correct warning text', () => result.then(data => (
53
+ it('correct warning text', () => result.then((data) => (
54
54
  expect(data.results[0].warnings[0].text).toBe('Expected "50%" to be "0.5" (alpha-value-notation)')
55
55
  )));
56
56
 
57
- it('correct rule flagged', () => result.then(data => (
57
+ it('correct rule flagged', () => result.then((data) => (
58
58
  expect(data.results[0].warnings[0].rule).toBe('alpha-value-notation')
59
59
  )));
60
60
 
61
- it('correct severity flagged', () => result.then(data => (
61
+ it('correct severity flagged', () => result.then((data) => (
62
62
  expect(data.results[0].warnings[0].severity).toBe('error')
63
63
  )));
64
64
 
65
- it('correct line number', () => result.then(data => (
65
+ it('correct line number', () => result.then((data) => (
66
66
  expect(data.results[0].warnings[0].line).toBe(2)
67
67
  )));
68
68
 
69
- it('correct column number', () => result.then(data => (
69
+ it('correct column number', () => result.then((data) => (
70
70
  expect(data.results[0].warnings[0].column).toBe(25)
71
71
  )));
72
72
  });
@@ -15,13 +15,13 @@ describe('strict Stylelint rules', () => {
15
15
  beforeEach(() => {
16
16
  result = stylelint.lint({
17
17
  code: validCSS,
18
- config: strictConfig
18
+ config: strictConfig,
19
19
  });
20
20
  });
21
21
 
22
- it('did not error', () => result.then(data => expect(data.errored).toBeFalsy()));
22
+ it('did not error', () => result.then((data) => expect(data.errored).toBeFalsy()));
23
23
 
24
- it('flags no warnings', () => result.then(data => (
24
+ it('flags no warnings', () => result.then((data) => (
25
25
  expect(data.results[0].warnings.length).toBe(0)
26
26
  )));
27
27
  });
@@ -38,35 +38,35 @@ describe('strict Stylelint rules', () => {
38
38
  beforeEach(() => {
39
39
  result = stylelint.lint({
40
40
  code: invalidCSS,
41
- config: strictConfig
41
+ config: strictConfig,
42
42
  });
43
43
  });
44
44
 
45
- it('did error', () => result.then(data => (
45
+ it('did error', () => result.then((data) => (
46
46
  expect(data.errored).toBeTruthy()
47
47
  )));
48
48
 
49
- it('flags one warning', () => result.then(data => (
49
+ it('flags one warning', () => result.then((data) => (
50
50
  expect(data.results[0].warnings.length).toBe(1)
51
51
  )));
52
52
 
53
- it('correct warning text', () => result.then(data => (
53
+ it('correct warning text', () => result.then((data) => (
54
54
  expect(data.results[0].warnings[0].text).toBe('Unexpected named color "red" (color-named)')
55
55
  )));
56
56
 
57
- it('correct rule flagged', () => result.then(data => (
57
+ it('correct rule flagged', () => result.then((data) => (
58
58
  expect(data.results[0].warnings[0].rule).toBe('color-named')
59
59
  )));
60
60
 
61
- it('correct severity flagged', () => result.then(data => (
61
+ it('correct severity flagged', () => result.then((data) => (
62
62
  expect(data.results[0].warnings[0].severity).toBe('error')
63
63
  )));
64
64
 
65
- it('correct line number', () => result.then(data => (
65
+ it('correct line number', () => result.then((data) => (
66
66
  expect(data.results[0].warnings[0].line).toBe(2)
67
67
  )));
68
68
 
69
- it('correct column number', () => result.then(data => (
69
+ it('correct column number', () => result.then((data) => (
70
70
  expect(data.results[0].warnings[0].column).toBe(12)
71
71
  )));
72
72
  });
package/index.js CHANGED
@@ -3,5 +3,5 @@ module.exports = {
3
3
  './rules/base.js',
4
4
  './rules/strict.js',
5
5
  './rules/ordering.js'
6
- ]
6
+ ],
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/stylelint-config-pie",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Shareable Stylelint config for use with any front-end web projects across JET.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -22,7 +22,10 @@
22
22
  "stylelint-order": "5.x"
23
23
  },
24
24
  "scripts": {
25
- "test": "run -T jest"
25
+ "lint:scripts": "run -T eslint .",
26
+ "lint:scripts:fix": "run -T eslint . --fix",
27
+ "test": "run -T jest",
28
+ "test:ci": "yarn test"
26
29
  },
27
30
  "jest": {
28
31
  "testEnvironment": "jsdom"
package/rules/base.js CHANGED
@@ -36,6 +36,7 @@ module.exports = {
36
36
  }
37
37
  ],
38
38
  'comment-whitespace-inside': 'always',
39
+ 'custom-property-pattern': '^([a-z][a-z0-9]*)(-[-a-z0-9]+)*$',
39
40
  'declaration-bang-space-after': 'never',
40
41
  'declaration-bang-space-before': 'always',
41
42
  'declaration-block-no-duplicate-properties': [
package/rules/ordering.js CHANGED
@@ -7,37 +7,37 @@ module.exports = {
7
7
  {
8
8
  hasBlock: false,
9
9
  name: 'include',
10
- type: 'at-rule'
10
+ type: 'at-rule',
11
11
  },
12
12
  'declarations',
13
13
  {
14
14
  hasBlock: true,
15
15
  name: 'include',
16
16
  parameter: /focus|hover/,
17
- type: 'at-rule'
17
+ type: 'at-rule',
18
18
  },
19
19
  {
20
20
  hasBlock: true,
21
21
  name: 'include',
22
22
  parameter: 'active',
23
- type: 'at-rule'
23
+ type: 'at-rule',
24
24
  },
25
25
  {
26
26
  selector: '^&:focus|hover$',
27
- type: 'rule'
27
+ type: 'rule',
28
28
  },
29
29
  {
30
30
  selector: '^&:active$',
31
- type: 'rule'
31
+ type: 'rule',
32
32
  },
33
33
  {
34
34
  hasBlock: true,
35
35
  name: 'include',
36
- type: 'at-rule'
36
+ type: 'at-rule',
37
37
  },
38
38
  {
39
39
  name: 'media',
40
- type: 'at-rule'
40
+ type: 'at-rule',
41
41
  },
42
42
  'rules'
43
43
  ],
@@ -46,16 +46,16 @@ module.exports = {
46
46
  'content',
47
47
  {
48
48
  emptyLineBefore: 'always',
49
- properties: ['position']
49
+ properties: ['position'],
50
50
  },
51
51
  {
52
52
  order: 'flexible',
53
- properties: ['top', 'bottom', 'left', 'right', 'z-index']
53
+ properties: ['top', 'bottom', 'left', 'right', 'z-index'],
54
54
  },
55
55
  {
56
56
  emptyLineBefore: 'always',
57
57
  order: 'flexible',
58
- properties: ['display', 'vertical-align']
58
+ properties: ['display', 'vertical-align'],
59
59
  },
60
60
  {
61
61
  emptyLineBefore: 'always',
@@ -75,7 +75,7 @@ module.exports = {
75
75
  'align-items',
76
76
  'align-self',
77
77
  'align'
78
- ]
78
+ ],
79
79
  },
80
80
  {
81
81
  emptyLineBefore: 'always',
@@ -91,7 +91,7 @@ module.exports = {
91
91
  'overflow-x',
92
92
  'overflow-y',
93
93
  'box-sizing'
94
- ]
94
+ ],
95
95
  },
96
96
  {
97
97
  emptyLineBefore: 'always',
@@ -107,7 +107,7 @@ module.exports = {
107
107
  'padding-bottom',
108
108
  'padding-left',
109
109
  'padding-right'
110
- ]
110
+ ],
111
111
  },
112
112
  {
113
113
  emptyLineBefore: 'always',
@@ -163,7 +163,7 @@ module.exports = {
163
163
  'background-repeat',
164
164
  'background-size',
165
165
  'box-shadow'
166
- ]
166
+ ],
167
167
  },
168
168
  {
169
169
  emptyLineBefore: 'always',
@@ -192,17 +192,17 @@ module.exports = {
192
192
  'text-underline-position',
193
193
  'white-space',
194
194
  'word'
195
- ]
195
+ ],
196
196
  },
197
197
  {
198
198
  emptyLineBefore: 'always',
199
199
  order: 'flexible',
200
- properties: ['opacity', 'visibility']
200
+ properties: ['opacity', 'visibility'],
201
201
  },
202
202
  {
203
203
  emptyLineBefore: 'always',
204
204
  order: 'flexible',
205
- properties: ['cursor', 'user-select', 'pointer-events']
205
+ properties: ['cursor', 'user-select', 'pointer-events'],
206
206
  },
207
207
  {
208
208
  emptyLineBefore: 'always',
@@ -225,8 +225,8 @@ module.exports = {
225
225
  'animation-name',
226
226
  'animation-play-state',
227
227
  'animation-timing-function'
228
- ]
228
+ ],
229
229
  }
230
- ]
231
- }
230
+ ],
231
+ },
232
232
  };
package/rules/strict.js CHANGED
@@ -4,6 +4,6 @@ module.exports = {
4
4
  'max-nesting-depth': 3,
5
5
  'media-query-list-comma-newline-after': 'always-multi-line',
6
6
  'selector-max-compound-selectors': 5,
7
- 'selector-max-id': 0
8
- }
7
+ 'selector-max-id': 0,
8
+ },
9
9
  };
@@ -1,123 +0,0 @@
1
-
2
- # Contributor Covenant Code of Conduct
3
-
4
- ## Our Pledge
5
-
6
- We as members, contributors, and leaders pledge to make participation in our
7
- community a harassment-free experience for everyone, regardless of age, body
8
- size, visible or invisible disability, ethnicity, sex characteristics, gender
9
- identity and expression, level of experience, education, socio-economic status,
10
- nationality, personal appearance, race, caste, color, religion, or sexual
11
- identity and orientation.
12
-
13
- We pledge to act and interact in ways that contribute to an open, welcoming,
14
- diverse, inclusive, and healthy community.
15
-
16
- ## Our Standards
17
-
18
- Examples of behavior that contributes to a positive environment for our
19
- community include:
20
-
21
- * Demonstrating empathy and kindness toward other people
22
- * Being respectful of differing opinions, viewpoints, and experiences
23
- * Giving and gracefully accepting constructive feedback
24
- * Accepting responsibility and apologizing to those affected by our mistakes,
25
- and learning from the experience
26
- * Focusing on what is best not just for us as individuals, but for the overall
27
- community
28
-
29
- Examples of unacceptable behavior include:
30
-
31
- * The use of sexualized language or imagery, and sexual attention or advances of
32
- any kind
33
- * Trolling, insulting or derogatory comments, and personal or political attacks
34
- * Public or private harassment
35
- * Publishing others' private information, such as a physical or email address,
36
- without their explicit permission
37
- * Other conduct which could reasonably be considered inappropriate in a
38
- professional setting
39
-
40
- ## Enforcement Responsibilities
41
-
42
- Community leaders are responsible for clarifying and enforcing our standards of
43
- acceptable behavior and will take appropriate and fair corrective action in
44
- response to any behavior that they deem inappropriate, threatening, offensive,
45
- or harmful.
46
-
47
- Community leaders have the right and responsibility to remove, edit, or reject
48
- comments, commits, code, wiki edits, issues, and other contributions that are
49
- not aligned to this Code of Conduct, and will communicate reasons for moderation
50
- decisions when appropriate.
51
-
52
- ## Scope
53
-
54
- This Code of Conduct applies within all community spaces, and also applies when
55
- an individual is officially representing the community in public spaces.
56
- Examples of representing our community include using an official e-mail address,
57
- posting via an official social media account, or acting as an appointed
58
- representative at an online or offline event.
59
-
60
- ## Enforcement
61
-
62
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
- reported to the community leaders responsible for enforcement by emailing
64
- [compliance.global@justeattakeaway.com](mailto:compliance.global@justeattakeaway.com).
65
- All complaints will be reviewed and investigated promptly and fairly.
66
-
67
- All community leaders are obligated to respect the privacy and security of the
68
- reporter of any incident.
69
-
70
- ## Enforcement Guidelines
71
-
72
- Community leaders will follow these Community Impact Guidelines in determining
73
- the consequences for any action they deem in violation of this Code of Conduct:
74
-
75
- ### 1. Correction
76
-
77
- **Community Impact**: Use of inappropriate language or other behavior deemed
78
- unprofessional or unwelcome in the community.
79
-
80
- **Consequence**: A private, written warning from community leaders, providing
81
- clarity around the nature of the violation and an explanation of why the
82
- behavior was inappropriate. A public apology may be requested.
83
-
84
- ### 2. Warning
85
-
86
- **Community Impact**: A violation through a single incident or series of
87
- actions.
88
-
89
- **Consequence**: A warning with consequences for continued behavior. No
90
- interaction with the people involved, including unsolicited interaction with
91
- those enforcing the Code of Conduct, for a specified period of time. This
92
- includes avoiding interactions in community spaces as well as external channels
93
- like social media. Violating these terms may lead to a temporary or permanent
94
- ban.
95
-
96
- ### 3. Temporary Ban
97
-
98
- **Community Impact**: A serious violation of community standards, including
99
- sustained inappropriate behavior.
100
-
101
- **Consequence**: A temporary ban from any sort of interaction or public
102
- communication with the community for a specified period of time. No public or
103
- private interaction with the people involved, including unsolicited interaction
104
- with those enforcing the Code of Conduct, is allowed during this period.
105
- Violating these terms may lead to a permanent ban.
106
-
107
- ### 4. Permanent Ban
108
-
109
- **Community Impact**: Demonstrating a pattern of violation of community
110
- standards, including sustained inappropriate behavior, harassment of an
111
- individual, or aggression toward or disparagement of classes of individuals.
112
-
113
- **Consequence**: A permanent ban from any sort of public interaction within the
114
- community.
115
-
116
- ## Attribution
117
-
118
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
- version 2.1, available at
120
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
-
122
- [homepage]: https://www.contributor-covenant.org
123
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html