Skip to content

Commit

Permalink
chore: remove lint configs from package and move into own files
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmenendez committed Nov 18, 2024
1 parent 711eb72 commit ab3838b
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 143 deletions.
25 changes: 25 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [2, 'always', 72],
'body-max-line-length': [2, 'always', 80],
'scope-case': [0, 'always', 'lower-case'],
'type-enum': [
2,
'always',
[
'build',
'ci',
'chore',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
};
60 changes: 60 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
presets: ['@babel/preset-react'],
},
},
plugins: ['ssr-friendly'],
ignorePatterns: ['packages/ibm-products-web-components/**/*'],
extends: ['carbon', 'plugin:ssr-friendly/recommended'],
rules: {
'react/display-name': [0],
'react/forbid-component-props': [
2,
{
forbid: [
{
propName: 'style',
disallowedFor: ['Datagrid', 'Carousel', 'Checklist', 'Coachmark'],
message: 'Avoid using style prop',
},
],
},
],
'react/forbid-dom-props': [
2,
{
forbid: [
{
propName: 'style',
disallowedFor: ['Datagrid', 'Carousel', 'Checklist', 'Coachmark'],
message: 'Avoid using style prop',
},
],
},
],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
],
};
10 changes: 7 additions & 3 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
root: true,
extends: ['stylelint-config-ibm-products'],
extends: ['stylelint-config-carbon'],
rules: {
'import-notation': 'string',
'max-nesting-depth': null,
'scss/no-global-function-names': null,
'csstools/use-logical': null,
'scss/load-no-partial-leading-underscore': null,
'scss/double-slash-comment-inline': null,
'no-duplicate-selectors': null,
},
};
140 changes: 0 additions & 140 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,133 +123,6 @@
"ws": "^8.17.1",
"@carbon/ibm-products-styles": "^2.49.0"
},
"eslintConfig": {
"parser": "@babel/eslint-parser",
"parserOptions": {
"babelOptions": {
"presets": [
"@babel/preset-react"
]
}
},
"plugins": [
"ssr-friendly"
],
"ignorePatterns": [
"packages/ibm-products-web-components/**/*"
],
"extends": [
"carbon",
"plugin:ssr-friendly/recommended"
],
"rules": {
"react/display-name": [
0
],
"react/forbid-component-props": [
2,
{
"forbid": [
{
"propName": "style",
"disallowedFor": [
"Datagrid",
"Carousel",
"Checklist",
"Coachmark"
],
"message": "Avoid using style prop"
}
]
}
],
"react/forbid-dom-props": [
2,
{
"forbid": [
{
"propName": "style",
"disallowedFor": [
"Datagrid",
"Carousel",
"Checklist",
"Coachmark"
],
"message": "Avoid using style prop"
}
]
}
]
},
"overrides": [
{
"files": [
"*.ts",
"*.tsx"
],
"plugins": [
"@typescript-eslint"
],
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "after-used",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off"
}
}
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
72
],
"body-max-line-length": [
2,
"always",
80
],
"scope-case": [
0,
"always",
"lower-case"
],
"type-enum": [
2,
"always",
[
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test"
]
]
}
},
"lint-staged": {
"!(examples/**/*)**/*.{js,jsx,ts,tsx}": [
"npx prettier --cache --write",
Expand All @@ -270,18 +143,5 @@
"dependencies": {
"stylelint-plugin-carbon-tokens": "2.8.0"
},
"stylelint": {
"extends": [
"stylelint-config-carbon"
],
"rules": {
"max-nesting-depth": null,
"scss/no-global-function-names": null,
"csstools/use-logical": null,
"scss/load-no-partial-leading-underscore": null,
"scss/double-slash-comment-inline": null,
"no-duplicate-selectors": null
}
},
"packageManager": "[email protected]"
}

0 comments on commit ab3838b

Please sign in to comment.