Skip to content

Commit

Permalink
Fix(design-tokens): Fix eslint configuration #DS-1503
Browse files Browse the repository at this point in the history
  • Loading branch information
curdaj committed Oct 10, 2024
1 parent ff113b9 commit bd4326b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
'!.*.js',
'packages/analytics',
'packages/common',
'packages/design-tokens',
'packages/web-react',
'packages/web',
'packages/form-validations',
Expand Down
18 changes: 18 additions & 0 deletions packages/design-tokens/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .eslintignore

node_modules

# NOTE:
# The following directives are only relevant when linting the whole
# project directory, ie. running `eslint .` ⚠️

# If you compile JavaScript into some output folder, exclude it here
dist
build

# Highly recommended to re-include JavaScript dotfiles to lint them
# (This will cause .eslintrc.js to be linted by ESLint 🤘)
!.*.js

# Some tools use this pattern for their configuration files. Lint them!
!*.config.js
12 changes: 12 additions & 0 deletions packages/design-tokens/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
extends: ['../../.eslintrc', '@lmc-eu/eslint-config-typescript', '@lmc-eu/eslint-config-jest'],

parserOptions: {
ecmaVersion: 'latest',
project: './tsconfig.eslint.json',
},

rules: {
'prettier/prettier': 'off',
},
};
8 changes: 7 additions & 1 deletion packages/design-tokens/.stylelintrc.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import stylelintConfig from 'stylelint-config-spirit';

export default stylelintConfig;
export default {
...stylelintConfig,

rules: {
'prettier/prettier': null,
},
};
4 changes: 3 additions & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"build:js": "vite build",
"build:scss": "shx mkdir -p scss && shx cp -r src/scss/generated/* src/scss/@tokens.scss scss/",
"clean": "rimraf esm cjs umd scss types",
"lint": "stylelint ./src/**/*.scss",
"lint": "npm-run-all --serial lint:scripts lint:styles",
"lint:scripts": "eslint ./src/**/*.ts",
"lint:styles": "stylelint ./src/**/*.scss",
"test": "yarn lint",
"types": "tsc"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/design-tokens/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./", "./.eslintrc.cjs"]
}

0 comments on commit bd4326b

Please sign in to comment.