Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions config/eslint/base.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 2022,
'sourceType': 'module'
},
'plugins': ['@typescript-eslint'],
'extends': [
'eslint:recommended'
],
'env': {
'browser': true,
'node': true,
'mocha': true
},
'rules': {
'indent': ['error', 4, { 'SwitchCase': 1 }],
'no-empty': ['error', { 'allowEmptyCatch': true }],
'quotes': ['error', 'single', { 'avoidEscape': true }],
/**
* The codebase uses some while(true) statements.
* Refactor to remove this rule.
*/
'no-constant-condition': 0,
/**
* Less combines assignments with conditionals sometimes
*/
'no-cond-assign': 0,
'no-multiple-empty-lines': 'error'
}
};
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"description": "Less monorepo",
"homepage": "http://lesscss.org",
"scripts": {
"lint": "eslint packages/less --ext .js,.ts",
"lint:fix": "eslint packages/less --ext .js,.ts --fix",
"publish": "node scripts/bump-and-publish.js",
"publish:dry-run": "DRY_RUN=true node scripts/bump-and-publish.js",
"publish:beta": "node scripts/publish-beta.js",
Expand All @@ -28,7 +30,10 @@
"url": "https://github.com/less/less.js.git"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"all-contributors-cli": "~6.26.1",
"eslint": "^7.29.0",
"github-changes": "^1.1.2",
"husky": "~9.1.7",
"npm-run-all": "^4.1.5",
Expand Down
64 changes: 19 additions & 45 deletions packages/less/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,63 +1,37 @@
module.exports = {
'parser': '@typescript-eslint/parser',
'extends': 'eslint:recommended',
'parserOptions': {
'ecmaVersion': 2018,
'sourceType': 'module'
},
'plugins': ['@typescript-eslint'],
'env': {
'browser': true,
'node': true,
'mocha': true
},
'globals': {},
'rules': {
indent: ['error', 4, {
SwitchCase: 1
}],
'no-empty': ['error', { 'allowEmptyCatch': true }],
quotes: ['error', 'single', {
avoidEscape: true
}],
/**
* The codebase uses some while(true) statements.
* Refactor to remove this rule.
*/
'no-constant-condition': 0,
/**
* Less combines assignments with conditionals sometimes
*/
'no-cond-assign': 0,
/**
* @todo - remove when some kind of code style (XO?) is added
*/
'no-multiple-empty-lines': 'error'
},
'extends': ['../../config/eslint/base.cjs'],
'overrides': [
{
files: ['*.ts'],
extends: ['plugin:@typescript-eslint/recommended'],
'extends': ['plugin:@typescript-eslint/recommended'],
rules: {
/**
* Suppress until Less has better-defined types
* @see https://github.com/less/less.js/discussions/3786
*/
'@typescript-eslint/no-explicit-any': 0
}
},
{
files: ['lib/**/*.{js,ts}'],
rules: {
'no-unused-vars': 0,
'no-redeclare': 0
}
},
{
files: ['benchmark/**/*.{js,ts}', 'build/**/*.{js,ts}', 'scripts/**/*.{js,ts}'],
rules: {
'no-unused-vars': 0,
'no-redeclare': 0,
'no-undef': 0
}
},
{
files: ['test/**/*.{js,ts}', 'benchmark/index.js'],
/**
* @todo - fix later
*/
rules: {
'no-undef': 0,
'no-useless-escape': 0,
'no-unused-vars': 0,
'no-redeclare': 0,
'@typescript-eslint/no-unused-vars': 0
}
},
}
]
}
};
Loading
Loading