Skip to content

Commit

Permalink
fix breakages for stylelint 16 (#154)
Browse files Browse the repository at this point in the history
Signed-off-by: Kangrui Johann Ye <kangrui.ye@cloudflight.io>
  • Loading branch information
strawberry-choco authored Jan 4, 2024
1 parent 9a503b0 commit 1f4f2d7
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 38 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./packages/*/tsconfig.json', './packages/*/tsconfig.spec.json'],
ecmaVersion: "latest",
},
rules: {
'@cloudflight/typescript/package-force-absolute-version-dependencies': 'off',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudflight",
"version": "0.8.2",
"version": "0.8.3",
"scripts": {
"build": "yarn workspaces foreach -ptA run build-package",
"lint": "eslint . && eslint --config .eslintrc.format.js .",
Expand Down
12 changes: 6 additions & 6 deletions packages/stylelint-plugin-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ yarn add -D @cloudflight/stylelint-plugin-angular
pnpm add -D @cloudflight/stylelint-plugin-angular
```

Then put this in your `.stylelintrc.json` file:
Then put this in your `.stylelintrc.mjs` file:

```json
{
"plugins": ["@cloudflight/stylelint-plugin-angular"],
"extends": ["@cloudflight/stylelint-plugin-angular/recommended"],
"rules": {}
```js
/** @type {import('stylelint').Config} */
export default {
extends: ['@cloudflight/stylelint-plugin-angular'],
rules: {},
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-plugin-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/stylelint-plugin-angular",
"version": "0.8.2",
"version": "0.8.3",
"author": "Cloudflight GmbH",
"license": "Apache-2.0",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions packages/stylelint-plugin-angular/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// import {ngDeepSelectorPrefix} from './lib/rules/ng-deep-selector-prefix';

/** @type {import('stylelint').Config} */
module.exports = {
plugins: ['./lib/rules/ng-deep-selector-prefix'],
extends: ['@cloudflight/stylelint-plugin'],
rules: {
'cloudflight-stylelint-angular/ng-deep-selector-prefix': true,
},
};
3 changes: 0 additions & 3 deletions packages/stylelint-plugin-angular/src/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import stylelint, {Rule} from 'stylelint';
const stylelint = require('stylelint');

const ruleName = '@cloudflight-stylelint-angular/ng-deep-selector-prefix';
const ruleName = 'cloudflight-stylelint-angular/ng-deep-selector-prefix';

/** @type {import('stylelint').Rule} */
// eslint-disable-next-line func-style
const fn: Rule = () => (postcssRoot, postcssResult) => {
const fn = () => (postcssRoot, postcssResult) => {
const validOptions = stylelint.utils.validateOptions(postcssResult, ruleName);

if (!validOptions) {
Expand Down Expand Up @@ -32,4 +33,4 @@ fn.meta = {
url: 'https://github.com/cloudflightio/cloudflight-stylelint-plugin/blob/main/packages/stylelint-plugin-angular/src/lib/rules/ng-deep-selector-prefix.md',
};

export const ngDeepSelectorPrefix = stylelint.createPlugin(ruleName, fn);
module.exports = stylelint.createPlugin(ruleName, fn);
7 changes: 5 additions & 2 deletions packages/stylelint-plugin-angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"files": ["src/index.ts"],
"include": [
"src/**/*.js"
],
"compilerOptions": {
"target": "ES2015",
"useDefineForClassFields": true,
Expand All @@ -23,6 +25,7 @@
"noPropertyAccessFromIndexSignature": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"skipLibCheck": true
"skipLibCheck": true,
"allowJs": true
}
}
12 changes: 6 additions & 6 deletions packages/stylelint-plugin-vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ yarn add -D @cloudflight/stylelint-plugin-vue
pnpm add -D @cloudflight/stylelint-plugin-vue
```

Then put this in your `.stylelintrc.json` file:
Then put this in your `.stylelintrc.mjs` file:

```json
{
"plugins": ["@cloudflight/stylelint-plugin-vue"],
"extends": ["@cloudflight/stylelint-plugin-vue/recommended"],
"rules": {}
```js
/** @type {import('stylelint').Config} */
export default {
extends: ['@cloudflight/stylelint-plugin-vue'],
rules: {},
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-plugin-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/stylelint-plugin-vue",
"version": "0.8.2",
"version": "0.8.3",
"author": "Cloudflight GmbH",
"license": "Apache-2.0",
"scripts": {
Expand Down
5 changes: 0 additions & 5 deletions packages/stylelint-plugin-vue/recommended.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/stylelint-plugin-vue/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('stylelint').Config} */
module.exports = {
extends: ['@cloudflight/stylelint-plugin', 'stylelint-config-html/vue'],
};
1 change: 0 additions & 1 deletion packages/stylelint-plugin-vue/src/index.ts

This file was deleted.

7 changes: 5 additions & 2 deletions packages/stylelint-plugin-vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"files": ["src/index.ts"],
"files": [
"src/index.js"
],
"compilerOptions": {
"target": "ES2015",
"useDefineForClassFields": true,
Expand All @@ -23,6 +25,7 @@
"noPropertyAccessFromIndexSignature": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"skipLibCheck": true
"skipLibCheck": true,
"allowJs": true
}
}
11 changes: 6 additions & 5 deletions packages/stylelint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ yarn add -D @cloudflight/stylelint-plugin
pnpm add -D @cloudflight/stylelint-plugin
```

Then put this in your `.stylelintrc.json` file:
Then put this in your `.stylelintrc.mjs` file:

```json
{
"extends": ["@cloudflight/stylelint-plugin"],
"rules": {}
```js
/** @type {import('stylelint').Config} */
export default {
extends: ['@cloudflight/stylelint-plugin'],
rules: {},
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflight/stylelint-plugin",
"version": "0.8.2",
"version": "0.8.3",
"author": "Cloudflight GmbH",
"license": "Apache-2.0",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/stylelint-plugin/src/lib/stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('stylelint').Config} */
module.exports = {
plugins: ['stylelint-order'],
extends: ['stylelint-config-standard-scss'],
Expand Down

0 comments on commit 1f4f2d7

Please sign in to comment.