Skip to content

Commit

Permalink
Merge pull request #7678 from jrjohnson/lint-from-packages
Browse files Browse the repository at this point in the history
Move linting into workspaces
  • Loading branch information
jrjohnson authored Mar 4, 2024
2 parents 399bf53 + 8cc7536 commit dea6bed
Show file tree
Hide file tree
Showing 41 changed files with 909 additions and 483 deletions.
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

2 changes: 0 additions & 2 deletions .stylelintignore

This file was deleted.

31 changes: 5 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
"license": "MIT",
"author": "The Ilios Team ([email protected])",
"scripts": {
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.scss\"",
"lint:css:fix": "stylelint \"**/*.scss\" --fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"preinstall": "npx only-allow pnpm",
"lint": "pnpm run --parallel /^lint:.*/",
"lint:js": "pnpm run --parallel lint:js",
"lint:hbs": "pnpm run --parallel lint:hbs",
"lint:css": "pnpm run --parallel lint:css",
"lint:fix": "pnpm run --parallel lint:fix",
"start": "pnpm --filter frontend exec ember serve",
"start:lti-course-manager": "pnpm --filter lti-course-manager exec ember serve",
"start:lti-dashboard": "pnpm --filter lti-dashboard exec ember serve",
Expand All @@ -20,25 +18,6 @@
"test:lti-dashboard": "pnpm run --filter lti-dashboard test",
"test:test-app": "pnpm run --filter test-app test"
},
"devDependencies": {
"@babel/eslint-parser": "7.23.3",
"@babel/plugin-proposal-decorators": "^7.23.6",
"concurrently": "^8.2.2",
"ember-template-lint": "^5.13.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.0",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-qunit": "^8.0.1",
"eslint-plugin-yml": "^1.12.2",
"prettier": "^3.1.1",
"stylelint": "^15.11.0",
"stylelint-config-recommended-scss": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.1.0",
"stylelint-scss": "^5.0.0"
},
"engines": {
"node": ">= 20",
"yarn": "use pnpm",
Expand Down
13 changes: 13 additions & 0 deletions packages/frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
36 changes: 8 additions & 28 deletions .eslintrc.js → packages/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ module.exports = {
},
rules: {
'ember/classic-decorator-no-classic-methods': 0,
'ember/no-actions-hash': 0,
'ember/no-classic-classes': 0,
'ember/no-classic-components': 0,
'ember/no-component-lifecycle-hooks': 0,
'ember/no-get': 0,
'ember/no-mixins': 0,
'ember/no-new-mixins': 0,
'ember/no-runloop': 0,
'ember/require-tagless-components': 0,
'no-console': 1,
},
overrides: [
// node files
Expand All @@ -37,17 +31,13 @@ module.exports = {
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./packages/*/blueprints/*/index.js',
'./packages/*/config/**/*.js',
'./packages/*/ember-cli-build.js',
'./packages/*/index.js',
'./packages/*/testem.js',
'./packages/*/tests/dummy/config/**/*.js',
'./packages/frontend/lib/*/index.js',
'./packages/frontend/testem.browserstack.js',
'./packages/lti-course-manager/lib/*/index.js',
'./packages/lti-dashboard/lib/*/index.js',
'./packages/test-app/testem.browserstack.js',
'./ember-cli-build.js',
'./testem.js',
'./testem.browserstack.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
Expand All @@ -60,22 +50,12 @@ module.exports = {
},
{
// test files
files: ['packages/**/tests/**/*-test.{js,ts}'],
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'qunit/require-expect': [2, 'except-simple'],
'ember/no-classic-classes': 0,
},
},
{
// YAML files
files: [
'./.github/dependabot.yml',
'./.github/workflows/*.{yaml,yml}',
'./packages/**/translations/*.{yaml,yml}',
],
extends: ['plugin:yml/standard'],
parser: 'yaml-eslint-parser',
},
],
};
File renamed without changes.
8 changes: 8 additions & 0 deletions packages/frontend/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
File renamed without changes.
File renamed without changes.
26 changes: 22 additions & 4 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint:css": "stylelint \"**/*.scss\"",
"lint:css:fix": "stylelint \"**/*.scss\" --fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"deploy:production": "ember deploy production --activate",
"deploy:staging": "ember deploy staging --activate",
"deploy:test": "ember deploy development",
"preinstall": "npx only-allow pnpm"
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/plugin-proposal-decorators": "^7.23.7",
"@babel/eslint-parser": "^7.23.10",
"@babel/plugin-proposal-decorators": "^7.23.9",
"@ember/edition-utils": "^1.2.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
Expand All @@ -39,7 +46,6 @@
"browserslist": "^4.23.0",
"caniuse-db": "^1.0.30001593",
"class-validator": "^0.14.0",
"concurrently": "^8.2.2",
"ember-a11y-refocus": "3.0.2",
"ember-a11y-testing": "^6.1.1",
"ember-async-data": "^1.0.3",
Expand Down Expand Up @@ -86,6 +92,13 @@
"ember-source": "~5.6.0",
"ember-template-lint": "^5.13.0",
"ember-web-app": "^5.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-yml": "^1.12.2",
"file-saver": "^2.0.5",
"ilios-common": "workspace:*",
"loader.js": "^4.7.0",
Expand All @@ -95,13 +108,18 @@
"moment-timezone": "^0.5.42",
"pad": "^3.2.0",
"papaparse": "^5.4.1",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"query-string": "^9.0.0",
"qunit": "^2.20.0",
"qunit-dom": "^2.0.0",
"sass": "^1.71.1",
"scroll-into-view": "^1.16.2",
"striptags": "^3.2.0",
"stylelint": "^16.2.1",
"stylelint-config-recommended-scss": "^14.0.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0",
"stylelint-scss": "^6.2.0",
"terser-webpack-plugin": "^5.3.9",
"testem-failure-only-reporter": "^1.0.0",
"tracked-built-ins": "^3.3.0",
Expand Down Expand Up @@ -131,4 +149,4 @@
"moment": "^2.30.1",
"moment-timezone": "^0.5.42"
}
}
}
13 changes: 13 additions & 0 deletions packages/ilios-common/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
53 changes: 53 additions & 0 deletions packages/ilios-common/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]],
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
env: {
browser: true,
},
rules: {
'ember/no-get': 0,
'ember/no-runloop': 0,
},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
13 changes: 13 additions & 0 deletions packages/ilios-common/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
printWidth: 100,
},
},
],
};
8 changes: 8 additions & 0 deletions packages/ilios-common/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
8 changes: 8 additions & 0 deletions packages/ilios-common/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
extends: ['stylelint-config-recommended-scss', 'stylelint-prettier/recommended'],
rules: {
'property-disallowed-list': ['font-size', 'line-height'],
},
};
11 changes: 11 additions & 0 deletions packages/ilios-common/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

module.exports = {
extends: 'recommended',
rules: {
'no-implicit-this': {
//our helpers which do not take arguments have to be listed here
allow: ['browser-timezone', 'noop'],
},
},
};
27 changes: 24 additions & 3 deletions packages/ilios-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
"doc": "doc",
"test": "tests"
},
"scripts": {},
"scripts": {
"lint:css": "stylelint \"**/*.scss\"",
"lint:css:fix": "stylelint \"**/*.scss\" --fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix"
},
"dependencies": {
"@babel/core": "^7.23.7",
"@ember/render-modifiers": "^2.0.0",
Expand Down Expand Up @@ -88,14 +95,14 @@
"validator": ">= 13.1.0"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.23.7",
"@babel/eslint-parser": "^7.23.10",
"@babel/plugin-proposal-decorators": "^7.23.9",
"@ember/edition-utils": "^1.1.1",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^3.2.1",
"@embroider/test-setup": "^3.0.3",
"@ilios/ember-template-lint-plugin": "^3.0.0",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^8.2.2",
"ember-cli": "~5.6.0",
"ember-cli-clean-css": "^3.0.0",
"ember-cli-dependency-checker": "^3.3.2",
Expand All @@ -107,8 +114,22 @@
"ember-page-title": "^8.2.0",
"ember-resolver": "^11.0.1",
"ember-source": "~5.6.0",
"ember-template-lint": "^5.13.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.0.2",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-yml": "^1.12.2",
"loader.js": "^4.7.0",
"prettier": "^3.2.5",
"sass": "^1.71.1",
"stylelint": "^16.2.1",
"stylelint-config-recommended-scss": "^14.0.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-prettier": "^5.0.0",
"stylelint-scss": "^6.2.0",
"tracked-built-ins": "^3.1.1",
"webpack": "^5.89.0"
},
Expand Down
Loading

0 comments on commit dea6bed

Please sign in to comment.